Changeset 655 in 3DVCSoftware for trunk/source
- Timestamp:
- 23 Oct 2013, 23:01:30 (11 years ago)
- Location:
- trunk/source
- Files:
-
- 69 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/source/App/TAppDecoder/TAppDecTop.cpp ¶
r622 r655 60 60 #endif 61 61 { 62 ::memset (m_abDecFlag, 0, sizeof (m_abDecFlag));63 62 #if H_MV 64 63 for (Int i = 0; i < MAX_NUM_LAYER_IDS; i++) m_layerIdToDecIdx[i] = -1; … … 148 147 149 148 // main decoder loop 150 Bool recon_opened= false; // reconstruction file not yet opened. (must be performed after SPS is seen)149 Bool openedReconFile = false; // reconstruction file not yet opened. (must be performed after SPS is seen) 151 150 #else 152 151 #if H_3D … … 176 175 #endif 177 176 AnnexBStats stats = AnnexBStats(); 178 #if !H_MV179 Bool bPreviousPictureDecoded = false;180 #endif181 182 177 vector<uint8_t> nalUnit; 183 178 InputNALUnit nalu; … … 246 241 #endif 247 242 } 248 249 250 243 #else 251 244 if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu) ) 252 245 { 253 if(bPreviousPictureDecoded) 254 { 255 bNewPicture = true; 256 bPreviousPictureDecoded = false; 257 } 258 else 259 { 260 bNewPicture = false; 261 } 246 bNewPicture = false; 262 247 } 263 248 else … … 290 275 #endif 291 276 } 292 #if !H_MV293 bPreviousPictureDecoded = true;294 #endif295 277 } 296 278 } … … 311 293 TComPic* picLastCoded = m_ivPicLists.getPic( m_tDecTop[dI]->getLayerId(), pocLastPic ); 312 294 assert( picLastCoded != NULL ); 313 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170314 295 picLastCoded->compressMotion(1); 315 #else316 picLastCoded->compressMotion();317 #endif318 296 } 319 297 } … … 325 303 if ( m_pchReconFiles[decIdxLastPic] && !m_reconOpen[decIdxLastPic] ) 326 304 #else 327 if ( m_pchReconFile && ! recon_opened)305 if ( m_pchReconFile && !openedReconFile ) 328 306 #endif 329 307 { … … 338 316 #else 339 317 m_cTVideoIOYuvReconFile.open( m_pchReconFile, true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode 340 recon_opened= true;318 openedReconFile = true; 341 319 } 342 320 if ( bNewPicture && … … 466 444 { 467 445 TComList<TComPic*>::iterator iterPic = pcListPic->begin(); 468 Int not_displayed = 0; 469 470 while (iterPic != pcListPic->end()) 471 { 472 TComPic* pcPic = *(iterPic); 473 #if H_MV 474 if(pcPic->getOutputMark() && pcPic->getPOC() > m_pocLastDisplay[decIdx]) 475 #else 476 if(pcPic->getOutputMark() && pcPic->getPOC() > m_iPOCLastDisplay) 477 #endif 478 { 479 not_displayed++; 480 } 481 iterPic++; 482 } 483 iterPic = pcListPic->begin(); 446 Int numPicsNotYetDisplayed = 0; 484 447 485 448 while (iterPic != pcListPic->end()) 486 449 { 487 450 TComPic* pcPic = *(iterPic); 488 489 #if H_MV 490 if ( pcPic->getOutputMark() && (not_displayed > pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_pocLastDisplay[decIdx])) 491 #else 492 if ( pcPic->getOutputMark() && (not_displayed > pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_iPOCLastDisplay)) 493 #endif 494 { 495 // write to file 496 not_displayed--; 451 #if H_MV 452 if(pcPic->getOutputMark() && pcPic->getPOC() > m_pocLastDisplay[decIdx]) 453 #else 454 if(pcPic->getOutputMark() && pcPic->getPOC() > m_iPOCLastDisplay) 455 #endif 456 { 457 numPicsNotYetDisplayed++; 458 } 459 iterPic++; 460 } 461 iterPic = pcListPic->begin(); 462 if (numPicsNotYetDisplayed>2) 463 { 464 iterPic++; 465 } 466 467 TComPic* pcPic = *(iterPic); 468 if (numPicsNotYetDisplayed>2 && pcPic->isField()) //Field Decoding 469 { 470 TComList<TComPic*>::iterator endPic = pcListPic->end(); 471 endPic--; 472 iterPic = pcListPic->begin(); 473 while (iterPic != endPic) 474 { 475 TComPic* pcPicTop = *(iterPic); 476 iterPic++; 477 TComPic* pcPicBottom = *(iterPic); 478 479 #if H_MV 480 if ( pcPicTop->getOutputMark() && (numPicsNotYetDisplayed > pcPicTop->getNumReorderPics(tId) && !(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) 481 && pcPicBottom->getOutputMark() && (numPicsNotYetDisplayed > pcPicBottom->getNumReorderPics(tId) && (pcPicTop->getPOC() == m_pocLastDisplay[decIdx]+1 || m_pocLastDisplay[decIdx]<0))) 482 #else 483 if ( pcPicTop->getOutputMark() && (numPicsNotYetDisplayed > pcPicTop->getNumReorderPics(tId) && !(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) 484 && pcPicBottom->getOutputMark() && (numPicsNotYetDisplayed > pcPicBottom->getNumReorderPics(tId) && (pcPicTop->getPOC() == m_iPOCLastDisplay+1 || m_iPOCLastDisplay<0))) 485 #endif 486 { 487 // write to file 488 numPicsNotYetDisplayed = numPicsNotYetDisplayed-2; 497 489 #if H_MV 498 490 if ( m_pchReconFiles[decIdx] ) 499 491 #else 500 if ( m_pchReconFile ) 501 #endif 502 { 503 const Window &conf = pcPic->getConformanceWindow(); 504 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 505 #if H_MV 506 #if H_MV5 492 if ( m_pchReconFile ) 493 #endif 494 { 495 const Window &conf = pcPicTop->getConformanceWindow(); 496 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 497 498 const Bool isTff = pcPicTop->isTopField(); 499 #if H_MV 507 500 assert( conf .getScaledFlag() ); 508 501 assert( defDisp.getScaledFlag() ); 509 #endif 502 m_tVideoIOYuvReconFile[decIdx]->write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 503 #else 504 m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 505 #endif 506 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 507 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 508 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 509 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff ); 510 } 511 512 // update POC of display order 513 #if H_MV 514 m_pocLastDisplay[decIdx] = pcPic->getPOC(); 515 #else 516 m_iPOCLastDisplay = pcPicBottom->getPOC(); 517 #endif 518 519 // erase non-referenced picture in the reference picture list after display 520 if ( !pcPicTop->getSlice(0)->isReferenced() && pcPicTop->getReconMark() == true ) 521 { 522 #if !DYN_REF_FREE 523 pcPicTop->setReconMark(false); 524 525 // mark it should be extended later 526 pcPicTop->getPicYuvRec()->setBorderExtension( false ); 527 528 #else 529 pcPicTop->destroy(); 530 pcListPic->erase( iterPic ); 531 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 532 continue; 533 #endif 534 } 535 if ( !pcPicBottom->getSlice(0)->isReferenced() && pcPicBottom->getReconMark() == true ) 536 { 537 #if !DYN_REF_FREE 538 pcPicBottom->setReconMark(false); 539 540 // mark it should be extended later 541 pcPicBottom->getPicYuvRec()->setBorderExtension( false ); 542 543 #else 544 pcPicBottom->destroy(); 545 pcListPic->erase( iterPic ); 546 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 547 continue; 548 #endif 549 } 550 pcPicTop->setOutputMark(false); 551 pcPicBottom->setOutputMark(false); 552 } 553 } 554 } 555 else if (!pcPic->isField()) //Frame Decoding 556 { 557 iterPic = pcListPic->begin(); 558 while (iterPic != pcListPic->end()) 559 { 560 pcPic = *(iterPic); 561 562 #if H_MV 563 if ( pcPic->getOutputMark() && (numPicsNotYetDisplayed > pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_pocLastDisplay[decIdx])) 564 #else 565 if ( pcPic->getOutputMark() && (numPicsNotYetDisplayed > pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_iPOCLastDisplay)) 566 #endif 567 { 568 // write to file 569 numPicsNotYetDisplayed--; 570 #if H_MV 571 if ( m_pchReconFiles[decIdx] ) 572 #else 573 if ( m_pchReconFile ) 574 #endif 575 { 576 const Window &conf = pcPic->getConformanceWindow(); 577 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 578 #if H_MV 579 assert( conf .getScaledFlag() ); 580 assert( defDisp.getScaledFlag() ); 510 581 m_tVideoIOYuvReconFile[decIdx]->write( pcPic->getPicYuvRec(), 511 582 #else 512 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), 513 #endif 514 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 515 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 516 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 517 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 583 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), 584 #endif 585 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 586 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 587 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 588 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 589 } 590 591 // update POC of display order 592 #if H_MV 593 m_pocLastDisplay[decIdx] = pcPic->getPOC(); 594 #else 595 m_iPOCLastDisplay = pcPic->getPOC(); 596 #endif 597 598 // erase non-referenced picture in the reference picture list after display 599 if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true ) 600 { 601 #if !DYN_REF_FREE 602 pcPic->setReconMark(false); 603 604 // mark it should be extended later 605 pcPic->getPicYuvRec()->setBorderExtension( false ); 606 607 #else 608 pcPic->destroy(); 609 pcListPic->erase( iterPic ); 610 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 611 continue; 612 #endif 613 } 614 pcPic->setOutputMark(false); 518 615 } 519 616 520 // update POC of display order 521 #if H_MV 522 m_pocLastDisplay[decIdx] = pcPic->getPOC(); 523 #else 524 m_iPOCLastDisplay = pcPic->getPOC(); 525 #endif 526 527 // erase non-referenced picture in the reference picture list after display 528 if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true ) 529 { 530 #if !DYN_REF_FREE 531 pcPic->setReconMark(false); 532 533 // mark it should be extended later 534 pcPic->getPicYuvRec()->setBorderExtension( false ); 535 536 #else 537 pcPic->destroy(); 538 pcListPic->erase( iterPic ); 539 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 540 continue; 541 #endif 542 } 543 pcPic->setOutputMark(false); 544 } 545 546 iterPic++; 547 } 548 } 549 617 iterPic++; 618 } 619 } 620 } 550 621 /** \param pcListPic list of pictures to be written to file 551 622 \todo DYN_REF_FREE should be revised … … 560 631 { 561 632 return; 562 } 633 } 563 634 TComList<TComPic*>::iterator iterPic = pcListPic->begin(); 564 635 565 636 iterPic = pcListPic->begin(); 637 TComPic* pcPic = *(iterPic); 566 638 567 while (iterPic != pcListPic->end()) 568 { 569 TComPic* pcPic = *(iterPic); 570 571 if ( pcPic->getOutputMark() ) 572 { 573 // write to file 639 if (pcPic->isField()) //Field Decoding 640 { 641 TComList<TComPic*>::iterator endPic = pcListPic->end(); 642 endPic--; 643 TComPic *pcPicTop, *pcPicBottom = NULL; 644 while (iterPic != endPic) 645 { 646 pcPicTop = *(iterPic); 647 iterPic++; 648 pcPicBottom = *(iterPic); 649 650 if ( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() && !(pcPicTop->getPOC()%2) && (pcPicBottom->getPOC() == pcPicTop->getPOC()+1) ) 651 { 652 // write to file 574 653 #if H_MV 575 654 if ( m_pchReconFiles[decIdx] ) 576 655 #else 577 if ( m_pchReconFile )578 #endif 579 {580 const Window &conf = pcPic->getConformanceWindow();581 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window();582 #if H_MV 583 #if H_MV 5656 if ( m_pchReconFile ) 657 #endif 658 { 659 const Window &conf = pcPicTop->getConformanceWindow(); 660 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 661 const Bool isTff = pcPicTop->isTopField(); 662 #if H_MV 584 663 assert( conf .getScaledFlag() ); 585 664 assert( defDisp.getScaledFlag() ); 586 #endif 665 m_tVideoIOYuvReconFile[decIdx]->write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 666 #else 667 m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 668 #endif 669 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 670 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 671 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 672 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff ); 673 } 674 675 // update POC of display order 676 #if H_MV 677 m_pocLastDisplay[decIdx] = pcPic->getPOC(); 678 #else 679 m_iPOCLastDisplay = pcPicBottom->getPOC(); 680 #endif 681 // erase non-referenced picture in the reference picture list after display 682 if ( !pcPicTop->getSlice(0)->isReferenced() && pcPicTop->getReconMark() == true ) 683 { 684 #if !DYN_REF_FREE 685 pcPicTop->setReconMark(false); 686 687 // mark it should be extended later 688 pcPicTop->getPicYuvRec()->setBorderExtension( false ); 689 690 #else 691 pcPicTop->destroy(); 692 pcListPic->erase( iterPic ); 693 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 694 continue; 695 #endif 696 } 697 if ( !pcPicBottom->getSlice(0)->isReferenced() && pcPicBottom->getReconMark() == true ) 698 { 699 #if !DYN_REF_FREE 700 pcPicBottom->setReconMark(false); 701 702 // mark it should be extended later 703 pcPicBottom->getPicYuvRec()->setBorderExtension( false ); 704 705 #else 706 pcPicBottom->destroy(); 707 pcListPic->erase( iterPic ); 708 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 709 continue; 710 #endif 711 } 712 pcPicTop->setOutputMark(false); 713 pcPicBottom->setOutputMark(false); 714 715 #if !DYN_REF_FREE 716 if(pcPicTop) 717 { 718 pcPicTop->destroy(); 719 delete pcPicTop; 720 pcPicTop = NULL; 721 } 722 #endif 723 } 724 } 725 if(pcPicBottom) 726 { 727 pcPicBottom->destroy(); 728 delete pcPicBottom; 729 pcPicBottom = NULL; 730 } 731 } 732 else //Frame decoding 733 { 734 while (iterPic != pcListPic->end()) 735 { 736 pcPic = *(iterPic); 737 738 if ( pcPic->getOutputMark() ) 739 { 740 // write to file 741 #if H_MV 742 if ( m_pchReconFiles[decIdx] ) 743 #else 744 if ( m_pchReconFile ) 745 #endif 746 { 747 const Window &conf = pcPic->getConformanceWindow(); 748 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 749 #if H_MV 750 assert( conf .getScaledFlag() ); 751 assert( defDisp.getScaledFlag() ); 587 752 m_tVideoIOYuvReconFile[decIdx]->write( pcPic->getPicYuvRec(), 588 753 #else 589 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(),590 #endif 591 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),592 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),593 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),594 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() );595 }596 597 // update POC of display order754 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), 755 #endif 756 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 757 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 758 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 759 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 760 } 761 762 // update POC of display order 598 763 #if H_MV 599 764 m_pocLastDisplay[decIdx] = pcPic->getPOC(); 600 765 #else 601 m_iPOCLastDisplay = pcPic->getPOC();602 #endif 603 604 // erase non-referenced picture in the reference picture list after display605 if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true )606 {766 m_iPOCLastDisplay = pcPic->getPOC(); 767 #endif 768 769 // erase non-referenced picture in the reference picture list after display 770 if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true ) 771 { 607 772 #if !DYN_REF_FREE 608 pcPic->setReconMark(false);609 610 // mark it should be extended later611 pcPic->getPicYuvRec()->setBorderExtension( false );612 613 #else 614 pcPic->destroy();615 pcListPic->erase( iterPic );616 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised!617 continue;618 #endif 619 }620 pcPic->setOutputMark(false);621 }773 pcPic->setReconMark(false); 774 775 // mark it should be extended later 776 pcPic->getPicYuvRec()->setBorderExtension( false ); 777 778 #else 779 pcPic->destroy(); 780 pcListPic->erase( iterPic ); 781 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 782 continue; 783 #endif 784 } 785 pcPic->setOutputMark(false); 786 } 622 787 #if !H_MV 623 788 #if !DYN_REF_FREE 624 if(pcPic) 625 { 626 pcPic->destroy(); 627 delete pcPic; 628 pcPic = NULL; 629 } 630 #endif 631 #endif 632 iterPic++; 789 if(pcPic) 790 { 791 pcPic->destroy(); 792 delete pcPic; 793 pcPic = NULL; 794 } 795 #endif 796 #endif 797 iterPic++; 798 } 633 799 } 634 800 #if H_MV -
TabularUnified trunk/source/App/TAppDecoder/TAppDecTop.h ¶
r608 r655 72 72 #endif 73 73 // for output control 74 Bool m_abDecFlag[ MAX_GOP ]; ///< decoded flag in one GOP75 74 #if H_MV 76 75 Int m_pocLastDisplay [ MAX_NUM_LAYERS ]; ///< last POC in display order -
TabularUnified trunk/source/App/TAppEncoder/TAppEncCfg.cpp ¶
r622 r655 82 82 m_codedPivotValue = NULL; 83 83 m_targetPivotValue = NULL; 84 85 #if KWU_RC_MADPRED_E0227 86 m_depthMADPred = 0; 87 #endif 84 88 } 85 89 … … 224 228 in>>entry.m_interViewRefPosL[1][i]; 225 229 } 226 #if !H_MV5227 if (entry.m_numActiveRefLayerPics > 0 )228 {229 in>>entry.m_collocatedRefLayerIdx;230 }231 #endif232 230 #endif 233 231 return in; … … 369 367 ("NumberOfLayers", m_numberOfLayers , 1, "Number of layers") 370 368 #if !H_3D 371 #if H_MV5372 369 ("ScalabilityMask", m_scalabilityMask , 2 , "Scalability Mask") 373 #else374 ("ScalabilityMask", m_scalabilityMask , 1 , "Scalability Mask")375 #endif376 370 #else 377 371 ("ScalabilityMask", m_scalabilityMask , 3 , "Scalability Mask, 1: Texture 3: Texture + Depth ") 378 372 #endif 379 373 ("DimensionIdLen", m_dimensionIdLen , cfg_dimensionLength , "Number of bits used to store dimensions Id") 380 #if H_MV5381 374 ("ViewOrderIndex", m_viewOrderIndex , std::vector<Int>(1,0), "View Order Index per layer") 382 375 ("ViewId", m_viewId , std::vector<Int>(1,0), "View Id per View Order Index") 383 #else384 ("ViewId", m_viewId , std::vector<Int>(1,0), "View Id")385 #endif386 376 #if H_3D 387 377 ("DepthFlag", m_depthFlag , std::vector<Int>(1,0), "Depth Flag") … … 428 418 ("FramesToBeEncoded,f", m_framesToBeEncoded, 0, "Number of frames to be encoded (default=all)") 429 419 420 //Field coding parameters 421 ("FieldCoding", m_isField, false, "Signals if it's a field based coding") 422 ("TopFieldFirst, Tff", m_isTopFieldFirst, false, "In case of field based coding, signals whether if it's a top field first or not") 423 430 424 // Profile and level 431 425 ("Profile", m_profile, Profile::NONE, "Profile to be used when encoding (Incomplete)") … … 517 511 ("IlluCompEnable", m_abUseIC, std::vector<Bool>(2, true), "Enable illumination compensation") 518 512 #endif 519 #if LGE_INTER_SDC_E0156513 #if H_3D_INTER_SDC 520 514 ("InterSDC", m_bDepthInterSDCFlag, true, "Enable depth inter SDC") 521 515 #endif … … 594 588 ( "InitialQP", m_RCInitialQP, 0, "Rate control: initial QP" ) 595 589 ( "RCForceIntraQP", m_RCForceIntraQP, false, "Rate control: force intra QP to be equal to initial QP" ) 590 591 #if KWU_RC_VIEWRC_E0227 592 ("ViewWiseTargetBits, -vtbr" , m_viewTargetBits, std::vector<Int>(1, 32), "View-wise target bit-rate setting") 593 ("TargetBitAssign, -ta", m_viewWiseRateCtrl, false, "View-wise rate control on/off") 594 #endif 595 #if KWU_RC_MADPRED_E0227 596 ("DepthMADPred, -dm", m_depthMADPred, (UInt)0, "Depth based MAD prediction on/off") 597 #endif 596 598 #else 597 599 ("RateCtrl,-rc", m_enableRateCtrl, false, "Rate control on/off") 598 600 ("TargetBitrate,-tbr", m_targetBitrate, 0, "Input target bitrate") 599 601 ("NumLCUInUnit,-nu", m_numLCUInUnit, 0, "Number of LCUs in an Unit") 600 #endif 601 602 #if H_MV5 602 603 #if KWU_RC_VIEWRC_E0227 604 ("ViewWiseTargetBits, -vtbr" , m_viewTargetBits, std::vector<Int>(1, 32), "View-wise target bit-rate setting") 605 ("TargetBitAssign, -ta", m_viewWiseRateCtrl, false, "View-wise rate control on/off") 606 #endif 607 #if KWU_RC_MADPRED_E0227 608 ("DepthMADPred, -dm", m_depthMADPred, (UInt)0, "Depth based MAD prediction on/off") 609 #endif 610 #endif 611 603 612 #if H_MV 604 613 // VPS VUI … … 617 626 ("CtuBasedOffsetEnabledFlag" , m_ctuBasedOffsetEnabledFlag , std::vector< Bool >(1,0) ,MAX_NUM_LAYERS , "CtuBasedOffsetEnabledFlag per direct reference for the N-th layer") 618 627 ("MinHorizontalCtuOffsetPlus1" , m_minHorizontalCtuOffsetPlus1 , std::vector< Int >(1,0) ,MAX_NUM_LAYERS , "MinHorizontalCtuOffsetPlus1 per direct reference for the N-th layer") 619 #endif620 628 #endif 621 629 … … 762 770 if( k == 0 ) 763 771 { 764 #if H_MV5765 772 m_GOPListMvc[0][0].m_sliceType = 'I'; 766 #endif767 773 for( Int i = 1; i < MAX_GOP + 1; i++ ) 768 774 { … … 810 816 const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv); 811 817 818 if(m_isField) 819 { 820 //Frame height 821 m_iSourceHeightOrg = m_iSourceHeight; 822 //Field height 823 m_iSourceHeight = m_iSourceHeight >> 1; 824 //number of fields to encode 825 m_framesToBeEncoded *= 2; 826 } 827 812 828 for (list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++) 813 829 { … … 928 944 m_aiPad[1] = m_confBottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight; 929 945 m_iSourceHeight += m_confBottom; 946 if ( m_isField ) 947 { 948 m_iSourceHeightOrg += m_confBottom << 1; 949 m_aiPad[1] = m_confBottom << 1; 950 } 930 951 } 931 952 if (m_aiPad[0] % TComSPS::getWinUnitX(CHROMA_420) != 0) … … 968 989 // allocate slice-based dQP values 969 990 #if H_MV 970 #if H_MV5971 991 xResizeVector( m_viewOrderIndex ); 972 992 … … 988 1008 #if H_3D 989 1009 xResizeVector( m_depthFlag ); 990 #endif991 #else992 xResizeVector( m_viewId );993 #if H_3D994 xResizeVector( m_depthFlag );995 996 std::vector<Int> uniqueViewIds;997 for( Int layer = 0; layer < m_numberOfLayers; layer++ )998 {999 Bool isIn = false;1000 for ( Int i = 0 ; i < uniqueViewIds.size(); i++ )1001 {1002 isIn = isIn || ( m_viewId[ layer ] == uniqueViewIds[ i ] );1003 }1004 if ( !isIn )1005 {1006 uniqueViewIds.push_back( m_viewId[ layer ] );1007 }1008 }1009 m_iNumberOfViews = (Int) uniqueViewIds.size();1010 #endif1011 1012 1010 #endif 1013 1011 xResizeVector( m_fQP ); … … 1283 1281 xConfirmPara( (m_layerIdInNuh.size()!=1) && (m_layerIdInNuh.size() < m_numberOfLayers) , "LayerIdInNuh must be given for all layers. "); 1284 1282 1285 #if H_MV51286 1283 #if H_3D 1287 1284 xConfirmPara( m_scalabilityMask != 2 && m_scalabilityMask != 3, "Scalability Mask must be equal to 2 or 3. "); … … 1298 1295 1299 1296 m_dimIds.push_back( m_viewOrderIndex ); 1300 #else1301 #if H_3D1302 xConfirmPara( m_scalabilityMask != 1 && m_scalabilityMask != 3, "Scalability Mask must be equal to 1 or 3. ");1303 #else1304 xConfirmPara( m_scalabilityMask != 1 , "Scalability Mask must be equal to 1. ");1305 #endif1306 1307 m_dimIds.push_back( m_viewId );1308 const Int viewDimPosition = 0;1309 #if H_3D1310 if ( m_scalabilityMask & ( 1 << DEPTH_ID ) )1311 m_dimIds.push_back( m_depthFlag );1312 #endif1313 1314 #endif1315 1297 xConfirmPara( m_dimensionIdLen.size() < m_dimIds.size(), "DimensionIdLen must be given for all dimensions. " ); Int dimBitOffset[MAX_NUM_SCALABILITY_TYPES+1]; 1316 1298 … … 1329 1311 { 1330 1312 xConfirmPara( m_dimIds[j].size() < m_numberOfLayers, "DimensionId must be given for all layers and all dimensions. "); 1331 #if H_MV51332 1313 xConfirmPara( (m_dimIds[j][0] != 0) , "DimensionId of layer 0 must be 0. " ); 1333 #else1334 xConfirmPara( ( j != viewDimPosition ) && (m_dimIds[j][0] != 0), "DimensionId of layer 0 must be 0. " );1335 #endif1336 1314 xConfirmPara( m_dimensionIdLen[j] < 1 || m_dimensionIdLen[j] > 8, "DimensionIdLen must be greater than 0 and less than 9 in all dimensions. " ); 1337 1315 … … 1372 1350 xConfirmPara( allEqual , "Each layer shall have a different position in scalability space." ); 1373 1351 1352 #if !H_3D_FCO 1374 1353 if ( numDiff == 1 ) 1375 1354 { 1376 1355 Bool inc = m_dimIds[ lastDiff ][ i ] > m_dimIds[ lastDiff ][ j ]; 1377 #if H_MV51378 1356 Bool shallBeButIsNotIncreasing = ( !inc ) ; 1379 #else1380 Bool shallBeButIsNotIncreasing = ( !inc && ( lastDiff != viewDimPosition ) ) ;1381 #endif1382 1357 if ( shallBeButIsNotIncreasing ) 1383 1358 { 1384 1359 printf( "\nError: Positions of Layers %d and %d is not increasing in dimension %d \n", i, j, lastDiff); 1385 1360 } 1386 #if H_MV51387 1361 xConfirmPara( shallBeButIsNotIncreasing, "DimensionIds shall be increasing within one dimension. " ); 1388 #else1389 xConfirmPara( shallBeButIsNotIncreasing && ( lastDiff != viewDimPosition ), "DimensionIds shall be increasing within one dimension. " );1390 #endif1391 1362 } 1363 #endif 1392 1364 } 1393 1365 } 1394 1366 1395 #if H_MV51396 1367 /// ViewId 1397 1368 xConfirmPara( m_viewId.size() != m_iNumberOfViews, "The number of ViewIds must be equal to the number of views." ); … … 1399 1370 /// Layer sets 1400 1371 xConfirmPara( m_vpsNumLayerSets < 0 || m_vpsNumLayerSets > 1024, "VpsNumLayerSets must be greater than 0 and less than 1025. ") ; 1401 #else1402 xConfirmPara( m_vpsNumLayerSets < 0 || m_vpsNumLayerSets > 1024, "VpsNumLayerSets must be greater than 0 and less than 1025") ;1403 #endif1404 1372 for( Int lsIdx = 0; lsIdx < m_vpsNumLayerSets; lsIdx++ ) 1405 1373 { … … 1743 1711 Bool errorGOP=false; 1744 1712 Int checkGOP=1; 1745 Int numRefs = 1;1713 Int numRefs = m_isField ? 2 : 1; 1746 1714 Int refList[MAX_NUM_REF_PICS+1]; 1747 1715 refList[0]=0; 1716 if(m_isField) 1717 { 1718 refList[1] = 1; 1719 } 1748 1720 Bool isOK[MAX_GOP]; 1749 1721 for(Int i=0; i<MAX_GOP; i++) … … 2157 2129 xConfirmPara( (numLCUInPic % m_numLCUInUnit) != 0, "total number of LCUs in a frame should be completely divided by NumLCUInUnit" ); 2158 2130 2131 #if !KWU_FIX_URQ 2159 2132 m_iMaxDeltaQP = MAX_DELTA_QP; 2133 #endif 2160 2134 m_iMaxCuDQPDepth = MAX_CUDQP_DEPTH; 2161 2135 } 2162 2136 #endif 2163 #if H_MV52164 2137 #if H_MV 2165 2138 // VPS VUI … … 2184 2157 } 2185 2158 #endif 2186 #endif2187 2159 2188 2160 xConfirmPara(!m_TransquantBypassEnableFlag && m_CUTransquantBypassFlagValue, "CUTransquantBypassFlagValue cannot be 1 when TransquantBypassEnableFlag is 0"); … … 2250 2222 #endif 2251 2223 #if H_MV 2252 #if H_MV52253 2224 xPrintParaVector( "ViewIdVal" , m_viewId ); 2254 2225 xPrintParaVector( "ViewOrderIndex", m_viewOrderIndex ); 2255 #else2256 xPrintParaVector( "ViewId", m_viewId );2257 #endif2258 2226 #endif 2259 2227 #if H_3D … … 2268 2236 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - m_confLeft - m_confRight, m_iSourceHeight - m_confTop - m_confBottom, m_iFrameRate ); 2269 2237 printf("Internal Format : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate ); 2238 if (m_isField) 2239 { 2240 printf("Frame/Field : Field based coding\n"); 2241 printf("Field index : %u - %d (%d fields)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded ); 2242 if (m_isTopFieldFirst) 2243 { 2244 printf("Field Order : Top field first\n"); 2245 } 2246 else 2247 { 2248 printf("Field Order : Bottom field first\n"); 2249 } 2250 } 2251 else 2252 { 2253 printf("Frame/Field : Frame based coding\n"); 2270 2254 printf("Frame index : %u - %d (%d frames)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded ); 2255 } 2271 2256 printf("CU size / depth : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth ); 2272 2257 printf("RQT trans. size (min / max) : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize ); … … 2299 2284 printf("InitialQP : %d\n", m_RCInitialQP ); 2300 2285 printf("ForceIntraQP : %d\n", m_RCForceIntraQP ); 2286 2287 #if KWU_RC_MADPRED_E0227 2288 printf("Depth based MAD prediction : %d\n", m_depthMADPred); 2289 #endif 2290 #if KWU_RC_VIEWRC_E0227 2291 printf("View-wise Rate control : %d\n", m_viewWiseRateCtrl); 2292 if(m_viewWiseRateCtrl) 2293 { 2294 2295 printf("ViewWiseTargetBits : "); 2296 for (Int i = 0 ; i < m_iNumberOfViews ; i++) 2297 printf("%d ", m_viewTargetBits[i]); 2298 printf("\n"); 2299 } 2300 else 2301 { 2302 printf("TargetBitrate : %d\n", m_RCTargetBitrate ); 2303 } 2304 #endif 2301 2305 } 2302 2306 #else … … 2306 2310 printf("TargetBitrate : %d\n", m_targetBitrate); 2307 2311 printf("NumLCUInUnit : %d\n", m_numLCUInUnit); 2312 2313 #if KWU_RC_MADPRED_E0227 2314 printf("Depth based MAD prediction : %d\n", m_depthMADPred); 2315 #endif 2316 #if KWU_RC_VIEWRC_E0227 2317 printf("View-wise Rate control : %d\n", m_viewWiseRateCtrl); 2318 if(m_viewWiseRateCtrl) 2319 { 2320 2321 printf("ViewWiseTargetBits : "); 2322 for (Int i = 0 ; i < m_iNumberOfViews ; i++) 2323 printf("%d ", m_viewTargetBits[i]); 2324 printf("\n"); 2325 } 2326 else 2327 { 2328 printf("TargetBitrate : %d\n", m_targetBitrate ); 2329 } 2330 #endif 2308 2331 } 2309 2332 #endif … … 2414 2437 printf("DLT:%d ", m_useDLT ); 2415 2438 #endif 2416 #if LGE_INTER_SDC_E01562439 #if H_3D_INTER_SDC 2417 2440 printf( "interSDC: %d ", m_bDepthInterSDCFlag ? 1 : 0 ); 2418 2441 #endif -
TabularUnified trunk/source/App/TAppEncoder/TAppEncCfg.h ¶
r622 r655 69 69 std::vector<char*> m_pchReconFileList; ///< output reconstruction file names 70 70 Int m_numberOfLayers; ///< number of Layers to Encode 71 #if H_MV572 71 Int m_iNumberOfViews; ///< number of Layers that are views 73 #else74 #if H_3D75 Int m_iNumberOfViews; ///< number of Layers that are views76 #endif77 #endif78 72 #else 79 73 Char* m_pchReconFile; ///< output reconstruction file … … 83 77 std::vector< std::vector<Int> > m_dimIds; ///< dimension ids ( pointers to m_viewId and m_depthFlag 84 78 std::vector<Int> m_viewId; ///< view id 85 #if H_MV586 79 std::vector<Int> m_viewOrderIndex; ///< view order index 87 #endif88 80 #if H_3D 89 81 std::vector<Int> m_depthFlag; ///< depth flag … … 106 98 std::vector< std::vector<Int> > m_dependencyTypes; ///< Dependency types of direct reference layers 107 99 108 #if H_MV5109 100 // VPS VUI 110 101 Bool m_vpsVuiPresentFlag; … … 122 113 std::vector< std::vector<Bool > > m_ctuBasedOffsetEnabledFlag; 123 114 std::vector< std::vector<Int > > m_minHorizontalCtuOffsetPlus1; 124 #endif125 115 126 116 #if H_3D_IV_MERGE … … 149 139 UInt m_FrameSkip; ///< number of skipped frames from the beginning 150 140 Int m_iSourceWidth; ///< source width in pixel 151 Int m_iSourceHeight; ///< source height in pixel 141 Int m_iSourceHeight; ///< source height in pixel (when interlaced = field height) 142 143 Int m_iSourceHeightOrg; ///< original source height in pixel (when interlaced = frame height) 144 145 bool m_isField; ///< enable field coding 146 bool m_isTopFieldFirst; 147 152 148 Int m_conformanceMode; 153 149 Int m_confLeft; … … 367 363 Int m_RCInitialQP; ///< inital QP for rate control 368 364 Bool m_RCForceIntraQP; ///< force all intra picture to use initial QP or not 365 366 #if KWU_RC_VIEWRC_E0227 367 vector<Int> m_viewTargetBits; 368 Bool m_viewWiseRateCtrl; ///< Flag for using view-wise rate control 369 #endif 370 #if KWU_RC_MADPRED_E0227 371 UInt m_depthMADPred; 372 #endif 369 373 #else 370 374 Bool m_enableRateCtrl; ///< Flag for using rate control algorithm 371 375 Int m_targetBitrate; ///< target bitrate 372 376 Int m_numLCUInUnit; ///< Total number of LCUs in a frame should be completely divided by the NumLCUInUnit 377 378 #if KWU_RC_VIEWRC_E0227 379 vector<Int> m_viewTargetBits; 380 Bool m_viewWiseRateCtrl; ///< Flag for using view-wise rate control 381 #endif 382 #if KWU_RC_MADPRED_E0227 383 UInt m_depthMADPred; 384 #endif 373 385 #endif 374 386 Int m_useScalingListId; ///< using quantization matrix … … 457 469 Bool m_bUsePC; ///< flag for using Predictive Coding with QTL 458 470 #endif 459 #if LGE_INTER_SDC_E0156471 #if H_3D_INTER_SDC 460 472 Bool m_bDepthInterSDCFlag; ///< flag for inter SDC of depth map coding 461 473 #endif -
TabularUnified trunk/source/App/TAppEncoder/TAppEncTop.cpp ¶
r622 r655 88 88 vps.setTemporalNestingFlag(true); 89 89 } 90 #if H_MV591 90 vps.setMaxLayersMinus1( m_numberOfLayers - 1); 92 #else93 vps.setMaxLayers( m_numberOfLayers );94 #endif95 91 for(Int i = 0; i < MAX_TLAYER; i++) 96 92 { … … 124 120 xSetDependencies( vps ); 125 121 xSetProfileTierLevel ( vps ); 126 #if H_MV5127 122 xSetRepFormat ( vps ); 128 #endif129 123 xSetLayerSets ( vps ); 130 #if H_MV5131 124 xSetVPSVUI ( vps ); 132 #endif133 125 #if H_3D 134 #if !H_MV5135 vps.initViewIndex();136 #endif137 126 xSetVPSExtension2 ( vps ); 138 127 m_ivPicLists.setVPS ( &vps ); … … 140 129 141 130 142 #if H_MV5143 131 for(Int layerIdInVps = 0; layerIdInVps < m_numberOfLayers; layerIdInVps++) 144 #else145 for(Int layer = 0; layer < m_numberOfLayers; layer++)146 #endif147 132 { 148 133 m_frameRcvd .push_back(0); … … 151 136 m_acTVideoIOYuvReconFileList.push_back(new TVideoIOYuv); 152 137 m_picYuvRec .push_back(new TComList<TComPicYuv*>) ; 153 #if H_MV5154 138 m_ivPicLists.push_back( m_acTEncTopList[ layerIdInVps ]->getListPic() ); 155 139 TEncTop& m_cTEncTop = *m_acTEncTopList[ layerIdInVps ]; // It is not a member, but this name helps avoiding code duplication !!! … … 160 144 m_cTEncTop.setViewId ( vps.getViewId ( layerId ) ); 161 145 m_cTEncTop.setViewIndex ( vps.getViewIndex ( layerId ) ); 162 #else163 m_ivPicLists.push_back( m_acTEncTopList[ layer ]->getListPic() );164 TEncTop& m_cTEncTop = *m_acTEncTopList[ layer ]; // It is not a member, but this name helps avoiding code duplication !!!165 166 m_cTEncTop.setLayerIdInVps ( layer );167 m_cTEncTop.setLayerId ( vps.getLayerIdInNuh( layer ) );168 m_cTEncTop.setViewId ( vps.getViewId ( layer ) );169 170 #endif171 146 #if H_3D 172 #if H_MV5173 147 Bool isDepth = ( vps.getDepthId ( layerId ) != 0 ) ; 174 #else175 Bool isDepth = ( vps.getDepthId ( layer ) != 0 ) ;176 m_cTEncTop.setViewIndex ( vps.getViewIndex ( layer ) );177 #endif178 148 m_cTEncTop.setIsDepth ( isDepth ); 179 149 //====== Camera Parameters ========= … … 201 171 m_cTEncTop.setDWeight ( isDepth ? m_iDWeight : 0 ); 202 172 #endif // H_3D_VSO 203 #if H_MV5204 173 #if H_3D_ARP 205 174 //====== Advanced Inter-view Residual Prediction ========= … … 209 178 #if H_3D_IC 210 179 m_cTEncTop.setUseIC ( vps.getViewIndex( layerId ) == 0 ? false : m_abUseIC[isDepth ? 1 : 0] ); 211 #endif212 #else213 #if H_3D_ARP214 //====== Advanced Inter-view Residual Prediction =========215 m_cTEncTop.setUseAdvRP ( ( isDepth || 0==layer ) ? 0 : m_uiUseAdvResPred );216 m_cTEncTop.setARPStepNum ( ( isDepth || 0==layer ) ? 1 : H_3D_ARP_WFNR );217 #endif218 #if H_3D_IC219 m_cTEncTop.setUseIC ( vps.getViewIndex( layer ) == 0 ? false : m_abUseIC[isDepth ? 1 : 0] );220 #endif221 180 #endif 222 181 //========== Depth intra modes ========== … … 232 191 #endif 233 192 //====== Depth Inter SDC ========= 234 #if LGE_INTER_SDC_E0156193 #if H_3D_INTER_SDC 235 194 m_cTEncTop.setInterSDCEnable ( isDepth ? m_bDepthInterSDCFlag : false ); 236 195 #endif … … 260 219 m_cTEncTop.setGOPSize ( m_iGOPSize ); 261 220 #if H_MV 262 #if H_MV5263 221 m_cTEncTop.setGopList ( m_GOPListMvc[layerIdInVps] ); 264 222 m_cTEncTop.setExtraRPSs ( m_extraRPSsMvc[layerIdInVps] ); … … 269 227 } 270 228 #else 271 m_cTEncTop.setGopList ( m_GOPListMvc[layer] );272 m_cTEncTop.setExtraRPSs ( m_extraRPSsMvc[layer] );273 for(Int i = 0; i < MAX_TLAYER; i++)274 {275 m_cTEncTop.setNumReorderPics ( m_numReorderPicsMvc[layer][i], i );276 m_cTEncTop.setMaxDecPicBuffering ( m_maxDecPicBufferingMvc[layer][i], i );277 }278 #endif279 #else280 229 m_cTEncTop.setGopList ( m_GOPList ); 281 230 m_cTEncTop.setExtraRPSs ( m_extraRPSs ); … … 291 240 } 292 241 #if H_MV 293 #if H_MV5294 242 m_cTEncTop.setQP ( m_iQP[layerIdInVps] ); 295 243 #else 296 m_cTEncTop.setQP ( m_iQP[layer] );297 #endif298 #else299 244 m_cTEncTop.setQP ( m_iQP ); 300 245 #endif … … 303 248 304 249 #if H_MV 305 #if H_MV5306 250 m_cTEncTop.setMaxTempLayer ( m_maxTempLayerMvc[layerIdInVps] ); 307 251 #else 308 m_cTEncTop.setMaxTempLayer ( m_maxTempLayerMvc[layer] );309 #endif310 #else311 252 m_cTEncTop.setMaxTempLayer ( m_maxTempLayer ); 312 253 #endif … … 317 258 //====== Loop/Deblock Filter ======== 318 259 #if H_MV 319 #if H_MV5320 260 m_cTEncTop.setLoopFilterDisable ( m_bLoopFilterDisable[layerIdInVps]); 321 #else322 m_cTEncTop.setLoopFilterDisable ( m_bLoopFilterDisable[layer]);323 #endif324 261 #else 325 262 m_cTEncTop.setLoopFilterDisable ( m_bLoopFilterDisable ); … … 351 288 352 289 #if H_MV 353 #if H_MV5354 290 if ((m_iMaxDeltaQP == 0 ) && (m_iQP[layerIdInVps] == lowestQP) && (m_useLossless == true)) 355 #else356 if ((m_iMaxDeltaQP == 0 ) && (m_iQP[layer] == lowestQP) && (m_useLossless == true))357 #endif358 291 #else 359 292 if ((m_iMaxDeltaQP == 0 ) && (m_iQP == lowestQP) && (m_useLossless == true)) … … 372 305 m_cTEncTop.setUseLossless ( m_useLossless ); 373 306 #if H_MV 374 #if H_MV5375 307 m_cTEncTop.setdQPs ( m_aidQP[layerIdInVps] ); 376 #else377 m_cTEncTop.setdQPs ( m_aidQP[layer] );378 #endif379 308 #else 380 309 m_cTEncTop.setdQPs ( m_aidQP ); … … 435 364 m_cTEncTop.setLFCrossSliceBoundaryFlag( m_bLFCrossSliceBoundaryFlag ); 436 365 #if H_MV 437 #if H_MV5438 366 m_cTEncTop.setUseSAO ( m_bUseSAO[layerIdInVps] ); 439 #else440 m_cTEncTop.setUseSAO ( m_bUseSAO[layer] );441 #endif442 367 #else 443 368 m_cTEncTop.setUseSAO ( m_bUseSAO ); … … 512 437 m_cTEncTop.setSignHideFlag(m_signHideFlag); 513 438 #if RATE_CONTROL_LAMBDA_DOMAIN 514 m_cTEncTop.setUseRateCtrl ( m_RCEnableRateControl ); 439 #if KWU_RC_VIEWRC_E0227 || KWU_RC_MADPRED_E0227 440 if(!m_cTEncTop.getIsDepth()) //only for texture 441 { 442 m_cTEncTop.setUseRateCtrl ( m_RCEnableRateControl ); 443 } 444 else 445 { 446 m_cTEncTop.setUseRateCtrl ( 0 ); 447 } 448 #else 449 m_cTEncTop.setUseRateCtrl ( m_RCEnableRateControl ); 450 #endif 451 #if !KWU_RC_VIEWRC_E0227 515 452 m_cTEncTop.setTargetBitrate ( m_RCTargetBitrate ); 453 #endif 516 454 m_cTEncTop.setKeepHierBit ( m_RCKeepHierarchicalBit ); 517 455 m_cTEncTop.setLCULevelRC ( m_RCLCULevelRC ); … … 519 457 m_cTEncTop.setInitialQP ( m_RCInitialQP ); 520 458 m_cTEncTop.setForceIntraQP ( m_RCForceIntraQP ); 521 #else 522 m_cTEncTop.setUseRateCtrl ( m_enableRateCtrl); 523 m_cTEncTop.setTargetBitrate ( m_targetBitrate); 524 m_cTEncTop.setNumLCUInUnit ( m_numLCUInUnit); 459 460 #if KWU_RC_MADPRED_E0227 461 if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth()) 462 { 463 m_cTEncTop.setUseDepthMADPred(layerIdInVps ? m_depthMADPred : 0); 464 465 if(m_cTEncTop.getUseDepthMADPred()) 466 { 467 m_cTEncTop.setCamParam(&m_cCameraData); 468 } 469 } 470 #endif 471 #if KWU_RC_VIEWRC_E0227 472 if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth()) 473 { 474 m_cTEncTop.setUseViewWiseRateCtrl(m_viewWiseRateCtrl); 475 476 if(m_iNumberOfViews == 1) 477 { 478 if(m_viewWiseRateCtrl) 479 { 480 m_cTEncTop.setTargetBitrate(m_viewTargetBits[layerIdInVps>>1]); 481 } 482 else 483 { 484 m_cTEncTop.setTargetBitrate ( m_RCTargetBitrate ); 485 } 486 } 487 else 488 { 489 if(m_viewWiseRateCtrl) 490 { 491 m_cTEncTop.setTargetBitrate(m_viewTargetBits[layerIdInVps>>1]); 492 } 493 else 494 { 495 if(m_iNumberOfViews == 2) 496 { 497 if(m_cTEncTop.getViewId() == 0) 498 { 499 m_cTEncTop.setTargetBitrate ( (m_RCTargetBitrate*80)/100 ); 500 } 501 else if(m_cTEncTop.getViewId() == 1) 502 { 503 m_cTEncTop.setTargetBitrate ( (m_RCTargetBitrate*20)/100 ); 504 } 505 } 506 else if(m_iNumberOfViews == 3) 507 { 508 if(m_cTEncTop.getViewId() == 0) 509 { 510 m_cTEncTop.setTargetBitrate ( (m_RCTargetBitrate*66)/100 ); 511 } 512 else if(m_cTEncTop.getViewId() == 1) 513 { 514 m_cTEncTop.setTargetBitrate ( (m_RCTargetBitrate*17)/100 ); 515 } 516 else if(m_cTEncTop.getViewId() == 2) 517 { 518 m_cTEncTop.setTargetBitrate ( (m_RCTargetBitrate*17)/100 ); 519 } 520 } 521 else 522 { 523 m_cTEncTop.setTargetBitrate ( m_RCTargetBitrate ); 524 } 525 } 526 } 527 } 528 #endif 529 #else 530 #if KWU_RC_VIEWRC_E0227 || KWU_RC_MADPRED_E0227 531 if(!m_cTEncTop.getIsDepth()) //only for texture 532 { 533 m_cTEncTop.setUseRateCtrl ( m_enableRateCtrl ); 534 m_cTEncTop.setTargetBitrate ( m_targetBitrate ); 535 m_cTEncTop.setNumLCUInUnit ( m_numLCUInUnit); 536 } 537 else 538 { 539 m_cTEncTop.setUseRateCtrl ( 0 ); 540 } 541 #else 542 m_cTEncTop.setUseRateCtrl ( m_enableRateCtrl ); 543 m_cTEncTop.setTargetBitrate ( m_targetBitrate ); 544 m_cTEncTop.setNumLCUInUnit ( m_numLCUInUnit); 545 #endif 546 547 548 #if KWU_RC_MADPRED_E0227 549 if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth()) 550 { 551 m_cTEncTop.setUseDepthMADPred(layerIdInVps ? m_depthMADPred : 0); 552 553 if(m_cTEncTop.getUseDepthMADPred()) 554 { 555 m_cTEncTop.setCamParam(&m_cCameraData); 556 } 557 } 558 #endif 559 560 #if KWU_RC_VIEWRC_E0227 561 if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth()) 562 { 563 m_cTEncTop.setUseViewWiseRateCtrl(m_viewWiseRateCtrl); 564 if(m_iNumberOfViews == 1) 565 { 566 if(m_viewWiseRateCtrl) 567 { 568 m_cTEncTop.setTargetBitrate(m_viewTargetBits[layerIdInVps>>1]); 569 } 570 else 571 { 572 m_cTEncTop.setTargetBitrate ( m_targetBitrate ); 573 } 574 } 575 else 576 { 577 if(m_viewWiseRateCtrl) 578 { 579 m_cTEncTop.setTargetBitrate(m_viewTargetBits[layerIdInVps>>1]); 580 } 581 else 582 { 583 if(m_iNumberOfViews == 2) 584 { 585 if(m_cTEncTop.getViewId() == 0) 586 { 587 m_cTEncTop.setTargetBitrate ( (m_targetBitrate*80)/100 ); 588 } 589 else if(m_cTEncTop.getViewId() == 1) 590 { 591 m_cTEncTop.setTargetBitrate ( (m_targetBitrate*20)/100 ); 592 } 593 } 594 else if(m_iNumberOfViews == 3) 595 { 596 if(m_cTEncTop.getViewId() == 0) 597 { 598 m_cTEncTop.setTargetBitrate ( (m_targetBitrate*66)/100 ); 599 } 600 else if(m_cTEncTop.getViewId() == 1) 601 { 602 m_cTEncTop.setTargetBitrate ( (m_targetBitrate*17)/100 ); 603 } 604 else if(m_cTEncTop.getViewId() == 2) 605 { 606 m_cTEncTop.setTargetBitrate ( (m_targetBitrate*17)/100 ); 607 } 608 } 609 else 610 { 611 m_cTEncTop.setTargetBitrate ( m_targetBitrate ); 612 } 613 } 614 } 615 } 616 #endif 525 617 #endif 526 618 m_cTEncTop.setTransquantBypassEnableFlag(m_TransquantBypassEnableFlag); … … 664 756 } 665 757 666 Void TAppEncTop::xInitLib( )758 Void TAppEncTop::xInitLib(Bool isFieldCoding) 667 759 { 668 760 #if H_MV 669 761 for(Int layer=0; layer<m_numberOfLayers; layer++) 670 762 { 671 m_acTEncTopList[layer]->init( ); 672 } 673 #else 674 m_cTEncTop.init(); 763 #if KWU_RC_MADPRED_E0227 764 m_acTEncTopList[layer]->init( isFieldCoding, this ); 765 #else 766 m_acTEncTopList[layer]->init( isFieldCoding ); 767 #endif 768 } 769 #else 770 m_cTEncTop.init( isFieldCoding ); 675 771 #endif 676 772 } … … 703 799 xInitLibCfg(); 704 800 xCreateLib(); 705 xInitLib( );801 xInitLib(m_isField); 706 802 707 803 // main encoder loop … … 728 824 729 825 // allocate original YUV buffer 826 if( m_isField ) 827 { 828 pcPicYuvOrg->create( m_iSourceWidth, m_iSourceHeightOrg, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 829 } 830 else 831 { 730 832 pcPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 833 } 731 834 732 835 #if H_MV … … 789 892 } 790 893 } 894 895 #if !RATE_CONTROL_LAMBDA_DOMAIN && KWU_FIX_URQ 896 for(Int layer=0; layer < m_numberOfLayers; layer++ ) 897 { 898 if(m_acTEncTopList[layer]->getUseRateCtrl() && !m_acTEncTopList[layer]->getIsDepth()) 899 { 900 m_acTEncTopList[layer]->getRateCtrl()->updateRCGOPStatus(); 901 } 902 } 903 #endif 904 791 905 gopSize = maxGopSize; 792 906 } 793 907 for(Int layer=0; layer < m_numberOfLayers; layer++ ) 794 908 { 795 m_acTEncTopList[layer]->printSummary( m_acTEncTopList[layer]->getNumAllPicCoded() );909 m_acTEncTopList[layer]->printSummary( m_acTEncTopList[layer]->getNumAllPicCoded(), m_isField ); 796 910 } 797 911 #else … … 807 921 m_iFrameRcvd++; 808 922 809 bEos = (m_i FrameRcvd == m_framesToBeEncoded);923 bEos = (m_isField && (m_iFrameRcvd == (m_framesToBeEncoded >> 1) )) || ( !m_isField && (m_iFrameRcvd == m_framesToBeEncoded) ); 810 924 811 925 Bool flush = 0; … … 820 934 821 935 // call encoding function for one frame 936 if ( m_isField ) 937 { 938 m_cTEncTop.encode( bEos, flush ? 0 : pcPicYuvOrg, m_cListPicYuvRec, outputAccessUnits, iNumEncoded, m_isTopFieldFirst); 939 } 940 else 941 { 822 942 m_cTEncTop.encode( bEos, flush ? 0 : pcPicYuvOrg, m_cListPicYuvRec, outputAccessUnits, iNumEncoded ); 943 } 823 944 824 945 // write bistream to file if necessary … … 830 951 } 831 952 832 m_cTEncTop.printSummary( );953 m_cTEncTop.printSummary(m_isField); 833 954 #endif 834 955 … … 941 1062 #endif 942 1063 { 943 Int i; 944 945 #if H_MV 946 if( iNumEncoded > 0 ) 947 { 948 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_picYuvRec[layerId]->end(); 949 #else 950 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_cListPicYuvRec.end(); 951 list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin(); 952 #endif 953 954 for ( i = 0; i < iNumEncoded; i++ ) 955 { 956 --iterPicYuvRec; 957 } 958 959 for ( i = 0; i < iNumEncoded; i++ ) 960 { 961 TComPicYuv* pcPicYuvRec = *(iterPicYuvRec++); 1064 if (m_isField) 1065 { 1066 //Reinterlace fields 1067 Int i; 1068 #if H_MV 1069 if( iNumEncoded > 0 ) 1070 { 1071 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_picYuvRec[layerId]->end(); 1072 #else 1073 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_cListPicYuvRec.end(); 1074 list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin(); 1075 #endif 1076 1077 for ( i = 0; i < iNumEncoded; i++ ) 1078 { 1079 --iterPicYuvRec; 1080 } 1081 1082 for ( i = 0; i < iNumEncoded/2; i++ ) 1083 { 1084 TComPicYuv* pcPicYuvRecTop = *(iterPicYuvRec++); 1085 TComPicYuv* pcPicYuvRecBottom = *(iterPicYuvRec++); 1086 962 1087 #if H_MV 963 1088 if (m_pchReconFileList[layerId]) 964 1089 { 965 m_acTVideoIOYuvReconFileList[layerId]->write( pcPicYuvRec, m_confLeft, m_confRight, m_confTop, m_confBottom ); 966 } 967 } 968 } 1090 m_acTVideoIOYuvReconFileList[layerId]->write( pcPicYuvRecTop, pcPicYuvRecBottom, m_confLeft, m_confRight, m_confTop, m_confBottom, m_isTopFieldFirst ); 1091 } 1092 } 1093 } 1094 969 1095 if( ! accessUnits.empty() ) 970 1096 { … … 972 1098 for( aUIter = accessUnits.begin(); aUIter != accessUnits.end(); aUIter++ ) 973 1099 { 1100 const vector<UInt>& stats = writeAnnexB(bitstreamFile, *aUIter); 1101 rateStatsAccum(*aUIter, stats); 1102 } 1103 } 1104 #else 1105 if (m_pchReconFile) 1106 { 1107 m_cTVideoIOYuvReconFile.write( pcPicYuvRecTop, pcPicYuvRecBottom, m_confLeft, m_confRight, m_confTop, m_confBottom, m_isTopFieldFirst ); 1108 } 1109 1110 const AccessUnit& auTop = *(iterBitstream++); 1111 const vector<UInt>& statsTop = writeAnnexB(bitstreamFile, auTop); 1112 rateStatsAccum(auTop, statsTop); 1113 1114 const AccessUnit& auBottom = *(iterBitstream++); 1115 const vector<UInt>& statsBottom = writeAnnexB(bitstreamFile, auBottom); 1116 rateStatsAccum(auBottom, statsBottom); 1117 } 1118 #endif 1119 } 1120 else 1121 { 1122 Int i; 1123 #if H_MV 1124 if( iNumEncoded > 0 ) 1125 { 1126 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_picYuvRec[layerId]->end(); 1127 #else 1128 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_cListPicYuvRec.end(); 1129 list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin(); 1130 #endif 1131 1132 for ( i = 0; i < iNumEncoded; i++ ) 1133 { 1134 --iterPicYuvRec; 1135 } 1136 1137 for ( i = 0; i < iNumEncoded; i++ ) 1138 { 1139 TComPicYuv* pcPicYuvRec = *(iterPicYuvRec++); 1140 #if H_MV 1141 if (m_pchReconFileList[layerId]) 1142 { 1143 m_acTVideoIOYuvReconFileList[layerId]->write( pcPicYuvRec, m_confLeft, m_confRight, m_confTop, m_confBottom ); 1144 } 1145 } 1146 } 1147 if( ! accessUnits.empty() ) 1148 { 1149 list<AccessUnit>::iterator aUIter; 1150 for( aUIter = accessUnits.begin(); aUIter != accessUnits.end(); aUIter++ ) 1151 { 974 1152 const vector<unsigned>& stats = writeAnnexB(bitstreamFile, *aUIter); 975 1153 rateStatsAccum(*aUIter, stats); … … 977 1155 } 978 1156 #else 979 if (m_pchReconFile) 980 { 981 m_cTVideoIOYuvReconFile.write( pcPicYuvRec, m_confLeft, m_confRight, m_confTop, m_confBottom ); 982 } 983 984 const AccessUnit& au = *(iterBitstream++); 985 const vector<UInt>& stats = writeAnnexB(bitstreamFile, au); 986 rateStatsAccum(au, stats); 987 } 988 #endif 989 } 990 1157 if (m_pchReconFile) 1158 { 1159 m_cTVideoIOYuvReconFile.write( pcPicYuvRec, m_confLeft, m_confRight, m_confTop, m_confBottom ); 1160 } 1161 1162 const AccessUnit& au = *(iterBitstream++); 1163 const vector<UInt>& stats = writeAnnexB(bitstreamFile, au); 1164 rateStatsAccum(au, stats); 1165 } 1166 #endif 1167 } 1168 } 1169 991 1170 /** 992 1171 * … … 1121 1300 Void TAppEncTop::xSetDimensionIdAndLength( TComVPS& vps ) 1122 1301 { 1123 #if H_MV51124 1302 vps.setScalabilityMaskFlag( m_scalabilityMask ); 1125 #else1126 vps.setScalabilityMask( m_scalabilityMask );1127 #endif1128 1303 for( Int dim = 0; dim < m_dimIds.size(); dim++ ) 1129 1304 { 1130 1305 vps.setDimensionIdLen( dim, m_dimensionIdLen[ dim ] ); 1131 #if H_MV51132 1306 for( Int layer = 0; layer <= vps.getMaxLayersMinus1(); layer++ ) 1133 #else1134 for( Int layer = 0; layer < vps.getMaxLayers(); layer++ )1135 #endif1136 1307 1137 1308 { … … 1140 1311 } 1141 1312 1142 #if H_MV51143 1313 Int maxViewId = xGetMax( m_viewId ); 1144 1314 … … 1153 1323 1154 1324 assert( m_iNumberOfViews == vps.getNumViews() ); 1155 #endif1156 1325 } 1157 1326 … … 1180 1349 1181 1350 // Max temporal id for inter layer reference pictures + presence flag 1182 #if H_MV51183 1351 Bool maxTidRefPresentFlag = false; 1184 #endif1185 1352 for ( Int refLayerIdInVps = 0; refLayerIdInVps < m_numberOfLayers; refLayerIdInVps++) 1186 1353 { … … 1203 1370 } 1204 1371 vps.setMaxTidIlRefPicPlus1( refLayerIdInVps, maxTid + 1 ); 1205 #if H_MV51206 1372 maxTidRefPresentFlag = maxTidRefPresentFlag || ( maxTid != 6 ); 1207 #endif 1208 } 1209 1210 #if H_MV5 1373 } 1374 1211 1375 vps.setMaxTidRefPresentFlag( maxTidRefPresentFlag ); 1212 #endif1213 1376 // Max one active ref layer flag 1214 1377 Bool maxOneActiveRefLayerFlag = true; 1215 #if H_MV51216 1378 for ( Int layerIdInVps = 1; layerIdInVps < m_numberOfLayers && maxOneActiveRefLayerFlag; layerIdInVps++) 1217 #else1218 for ( Int currLayerIdInVps = 1; currLayerIdInVps < m_numberOfLayers && maxOneActiveRefLayerFlag; currLayerIdInVps++)1219 #endif1220 1379 { 1221 1380 for( Int i = 0; i < ( getGOPSize() + 1) && maxOneActiveRefLayerFlag; i++ ) 1222 1381 { 1223 #if H_MV51224 1382 GOPEntry ge = m_GOPListMvc[layerIdInVps][ ( i < getGOPSize() ? i : MAX_GOP ) ]; 1225 #else1226 GOPEntry ge = m_GOPListMvc[currLayerIdInVps][ ( i < getGOPSize() ? i : MAX_GOP ) ];1227 #endif1228 1383 maxOneActiveRefLayerFlag = maxOneActiveRefLayerFlag && (ge.m_numActiveRefLayerPics <= 1); 1229 1384 } … … 1233 1388 1234 1389 1235 #if H_MV51236 1390 // All Ref layers active flag 1237 1391 Bool allRefLayersActiveFlag = true; … … 1249 1403 // Currently cross layer irap aligned is always true. 1250 1404 vps.setCrossLayerIrapAlignedFlag( true ); 1251 #endif1252 1405 vps.setRefLayers(); 1253 1406 }; 1254 1407 1255 #if H_MV51256 1408 GOPEntry* TAppEncTop::xGetGopEntry( Int layerIdInVps, Int poc ) 1257 1409 { … … 1268 1420 return geFound; 1269 1421 } 1270 #endif1271 1422 1272 1423 Void TAppEncTop::xSetLayerIds( TComVPS& vps ) … … 1308 1459 } 1309 1460 1310 #if H_MV51311 1461 1312 1462 Void TAppEncTop::xSetRepFormat( TComVPS& vps ) … … 1333 1483 } 1334 1484 } 1335 #endif1336 1485 1337 1486 Void TAppEncTop::xSetLayerSets( TComVPS& vps ) … … 1386 1535 } 1387 1536 } 1388 #if H_MV51389 1537 1390 1538 Void TAppEncTop::xSetVPSVUI( TComVPS& vps ) … … 1478 1626 } 1479 1627 #endif 1480 #endif1481 1628 #if H_3D 1482 1629 Void TAppEncTop::xSetVPSExtension2( TComVPS& vps ) 1483 1630 { 1484 #if H_MV51485 1631 1486 1632 for ( Int layer = 0; layer <= vps.getMaxLayersMinus1(); layer++ ) 1487 #else1488 for ( Int layer = 0; layer < vps.getMaxLayers(); layer++ )1489 #endif1490 1633 { 1491 1634 Bool isDepth = ( vps.getDepthId( layer ) == 1 ) ; … … 1517 1660 vps.setViewSynthesisPredFlag( layer, !isLayerZero && !isDepth && m_viewSynthesisPredFlag ); 1518 1661 #endif 1519 #if LGE_INTER_SDC_E01561662 #if H_3D_INTER_SDC 1520 1663 vps.setInterSDCFlag( layer, !isLayerZero && isDepth && m_bDepthInterSDCFlag ); 1521 1664 #endif -
TabularUnified trunk/source/App/TAppEncoder/TAppEncTop.h ¶
r622 r655 50 50 #endif 51 51 52 #if KWU_RC_MADPRED_E0227 53 class TEncTop; 54 #endif 52 55 //! \ingroup TAppEncoder 53 56 //! \{ … … 93 96 Void xCreateLib (); ///< create files & encoder class 94 97 Void xInitLibCfg (); ///< initialize internal variables 95 Void xInitLib ( );///< initialize encoder class98 Void xInitLib (Bool isFieldCoding); ///< initialize encoder class 96 99 Void xDestroyLib (); ///< destroy encoder class 97 100 … … 121 124 Void xSetLayerSets ( TComVPS& vps ); 122 125 Void xSetProfileTierLevel ( TComVPS& vps ); 123 #if H_MV5124 126 Void xSetRepFormat ( TComVPS& vps ); 125 127 Void xSetVPSVUI ( TComVPS& vps ); 126 128 GOPEntry* xGetGopEntry( Int layerIdInVps, Int poc ); 127 #endif128 129 Int xGetMax( std::vector<Int>& vec); 129 130 #endif -
TabularUnified trunk/source/Lib/TAppCommon/TAppComCamPara.cpp ¶
r608 r655 615 615 { 616 616 UInt uiFoundLine = -1; 617 #if H_3D_FIX_REN_WARNING618 617 if ( !xGetCameraDataRow( iView, uiFrame, uiFoundLine ) && xIsIn( m_aiSortedBaseViews, iView )) 619 #else620 if ( !xGetCameraDataRow( iView, uiFrame, uiFoundLine ) )621 #endif622 618 { 623 619 AOT( m_aadCameraParameters[ uiFoundLine ].size() < 6 ); … … 635 631 Int iDummy; 636 632 637 #if H_3D_FIX_REN_WARNING638 633 if( !xGetLeftRightView( iView, m_aiSortedBaseViews, iLeftView, iRightView, iDummy, iDummy ) || 639 #else640 if( !xGetLeftRightView( iView, m_aiViewsInCfgFile, iLeftView, iRightView, iDummy, iDummy ) ||641 #endif642 634 xGetCameraDataRow( iLeftView, uiFrame, uiLeftViewLine ) || 643 635 xGetCameraDataRow( iRightView, uiFrame, uiRightViewLine ) 644 636 ) 645 637 { 646 #if H_3D_FIX_REN_WARNING647 638 std::cerr << "No left or no right base view next to view " << (Double)iView / m_dViewNumPrec << " for Frame " << uiFrame << " given in CameraParameterFile" << std::endl; 648 #else649 std::cerr << "No Left or no Right View next to View " << (Double)iView / m_dViewNumPrec << " for Frame " << uiFrame << " given in CameraParameterFile" << std::endl;650 #endif651 639 AOT(true); 652 640 exit( EXIT_FAILURE ); … … 1352 1340 } 1353 1341 } 1354 #if H_3D_FIX_REN_WARNING 1342 1355 1343 Bool bIgnoreFirst = true; 1356 1344 for( UInt uiERView = 0; uiERView < m_aiSynthViews.size() && !m_bSetupFromCoded; uiERView++ ) … … 1371 1359 std::cout << std::endl; 1372 1360 } 1373 #endif1374 1361 1375 1362 Bool bInterpolateFirst = true; … … 1390 1377 if ( bInterpolateFirst ) 1391 1378 { 1392 #if H_3D_FIX_REN_WARNING1393 1379 std::cout << "Interpolating camera parameters for virtual view(s): " ; 1394 #else1395 std::cout << "Interpolating Camera Parameters for View(s) " ;1396 #endif1397 1380 bInterpolateFirst = false; 1398 1381 } … … 1498 1481 } 1499 1482 1500 #if H_3D_FIX_REN_WARNING1501 1483 Bool 1502 1484 TAppComCamPara::xIsIn( std::vector<Int>& rVec, Int iElem) … … 1509 1491 return bFound; 1510 1492 } 1511 #endif1512 1493 1513 1494 Int TAppComCamPara::getRelDistLeft( Int iSynthViewIdx, Int iLeftViewIdx, Int iRightViewIdx ) -
TabularUnified trunk/source/Lib/TAppCommon/TAppComCamPara.h ¶
r608 r655 125 125 Bool xGetLeftRightView ( Int iView, std::vector<Int> aiSortedViews, Int& riLeftView, Int& riRightView, Int& riLeftSortedViewIdx, Int& riRightSortedViewIdx ); 126 126 Void xGetPrevAndNextBaseView ( Int iSourceViewNum, Int iTargetViewNum, Int& riPrevBaseViewNum, Int& riNextBaseViewNum ); 127 #if !KWU_RC_MADPRED_E0227 127 128 Void xGetZNearZFar ( Int iView, UInt uiFrame, Double& rdZNear, Double& rdZFar ); 128 129 Void xGetGeometryData ( Int dView, UInt uiFrame, Double& rdFocalLength, Double& rdPosition, Double& rdCameraShift, Bool& rbInterpolated ); 130 #endif 129 131 Void xSetupBaseViewsFromCoded (); 130 132 Void xSetupBaseViews ( Char* pchBaseViewNumbers, UInt uiNumBaseViews ); 131 #if H_3D_FIX_REN_WARNING132 133 Bool xIsIn ( std::vector<Int>& rVec, Int iNumber); 133 #endif134 135 134 136 135 // functions for getting and setting scales and offsets … … 220 219 Int** getCodedScale () { return m_aaiCodedScale; } 221 220 Int** getCodedOffset () { return m_aaiCodedOffset; } 221 222 #if KWU_RC_MADPRED_E0227 223 Void xGetZNearZFar ( Int iView, UInt uiFrame, Double& rdZNear, Double& rdZFar ); 224 Void xGetGeometryData ( Int dView, UInt uiFrame, Double& rdFocalLength, Double& rdPosition, Double& rdCameraShift, Bool& rbInterpolated ); 225 #endif 222 226 }; 223 227 -
TabularUnified trunk/source/Lib/TLibCommon/CommonDef.h ¶
r625 r655 61 61 #if H_MV 62 62 #define NV_VERSION "8.1" ///< Current software version 63 #define HM_VERSION "1 1.0" ///<63 #define HM_VERSION "12.0" ///< 64 64 #else 65 #define NV_VERSION "1 1.0" ///< Current software version65 #define NV_VERSION "12.0" ///< Current software version 66 66 #endif 67 67 … … 187 187 } 188 188 189 #if H_MV5190 189 template <typename T> 191 190 __inline T gCeilLog2( T val ) … … 196 195 return ceilLog2; 197 196 } 198 #endif199 197 200 198 #define RemoveBitIncrement( exp ) ( exp >> ( g_bitDepthY - 8 ) ) -
TabularUnified trunk/source/Lib/TLibCommon/ContextTables.h ¶
r622 r655 112 112 #if H_3D_DIM_DMM 113 113 #define NUM_DMM1_DATA_CTX 1 ///< number of context models for DMM1 data 114 #if !SEC_DMM2_E0146_HHIFIX115 #define NUM_DMM2_DATA_CTX 1 ///< number of context models for DMM2 data116 #endif117 114 #define NUM_DMM3_DATA_CTX 1 ///< number of context models for DMM3 data 118 115 #endif … … 127 124 #endif 128 125 129 #if LGE_INTER_SDC_E0156126 #if H_3D_INTER_SDC 130 127 #define NUM_INTER_SDC_FLAG_CTX 1 ///< number of context models for inter SDC flag 131 128 #define NUM_INTER_SDC_SIGN_FLAG_CTX 1 ///< number of context models for sign of inter SDC residual … … 390 387 #endif 391 388 #if H_3D_DIM 392 #if ZJU_DEPTH_INTRA_MODE_E0204393 389 static const UChar 394 390 INIT_DEPTH_INTRA_MODE[3][NUM_DEPTH_INTRA_MODE_CTX] = … … 398 394 {64, 0, CNU, CNU, 168, 109, 0, 0} 399 395 }; 400 #else 401 static const UChar 402 INIT_DEPTH_INTRA_MODE[3][NUM_DEPTH_INTRA_MODE_CTX] = 403 { 404 {0, 0, 64, 0, CNU, 0, CNU, 0}, 405 {0, 64, 0, CNU, 0, CNU, 0, 0}, 406 {64, 0, CNU, 0, CNU, 0, 0, 0} 407 }; 408 #endif 396 409 397 static const UChar 410 398 INIT_DDC_FLAG[3][NUM_DDC_FLAG_CTX] = … … 429 417 { CNU }, 430 418 }; 431 #if !SEC_DMM2_E0146_HHIFIX432 static const UChar433 INIT_DMM2_DATA[3][NUM_DMM2_DATA_CTX] =434 {435 { CNU },436 { CNU },437 { CNU },438 };439 #endif440 419 static const UChar 441 420 INIT_DMM3_DATA[3][NUM_DMM3_DATA_CTX] = … … 473 452 #endif 474 453 475 #if LGE_INTER_SDC_E0156454 #if H_3D_INTER_SDC 476 455 static const UChar 477 456 INIT_INTER_SDC_FLAG[3][NUM_INTER_SDC_FLAG_CTX] = -
TabularUnified trunk/source/Lib/TLibCommon/TComDataCU.cpp ¶
r622 r655 120 120 m_dmmWedgeTabIdx[i] = NULL; 121 121 } 122 #if !SEC_DMM2_E0146_HHIFIX123 m_dmm2DeltaEnd = NULL;124 #endif125 122 m_dmm3IntraTabIdx = NULL; 126 123 #endif … … 153 150 m_pbICFlag = NULL; 154 151 #endif 155 #if LGE_INTER_SDC_E0156152 #if H_3D_INTER_SDC 156 153 m_pbInterSDCFlag = NULL; 157 154 for( Int i = 0; i < 4; i++ ) … … 274 271 m_dmmWedgeTabIdx[i] = (UInt*)xMalloc(UInt, uiNumPartition); 275 272 } 276 #if !SEC_DMM2_E0146_HHIFIX277 m_dmm2DeltaEnd = (Int* )xMalloc(Int, uiNumPartition);278 #endif279 273 m_dmm3IntraTabIdx = (UInt*)xMalloc(UInt, uiNumPartition); 280 274 #endif … … 292 286 #endif 293 287 #endif 294 #if LGE_INTER_SDC_E0156288 #if H_3D_INTER_SDC 295 289 m_pbInterSDCFlag = (Bool* )xMalloc(Bool, uiNumPartition); 296 290 for( Int i = 0; i < 4; i++ ) … … 305 299 m_acCUMvField[1].setNumPartition(uiNumPartition ); 306 300 } 307 #if LGE_INTER_SDC_E0156301 #if H_3D_INTER_SDC 308 302 m_pucInterSDCMask = (UChar* )xMalloc(UChar, g_uiMaxCUHeight*g_uiMaxCUWidth); 309 303 #endif … … 410 404 if ( m_dmmWedgeTabIdx[i] ) { xFree( m_dmmWedgeTabIdx[i] ); m_dmmWedgeTabIdx[i] = NULL; } 411 405 } 412 #if !SEC_DMM2_E0146_HHIFIX413 if ( m_dmm2DeltaEnd ) { xFree( m_dmm2DeltaEnd ); m_dmm2DeltaEnd = NULL; }414 #endif415 406 if ( m_dmm3IntraTabIdx ) { xFree( m_dmm3IntraTabIdx ); m_dmm3IntraTabIdx = NULL; } 416 407 #endif … … 428 419 #endif 429 420 #endif 430 #if LGE_INTER_SDC_E0156421 #if H_3D_INTER_SDC 431 422 if ( m_pbInterSDCFlag ) { xFree(m_pbInterSDCFlag); m_pbInterSDCFlag = NULL; } 432 423 for(Int i = 0; i < 4; i++ ) … … 436 427 #endif 437 428 } 438 #if LGE_INTER_SDC_E0156429 #if H_3D_INTER_SDC 439 430 if ( m_pucInterSDCMask ) { xFree(m_pucInterSDCMask); m_pucInterSDCMask = NULL; } 440 431 #endif … … 575 566 m_pbSDCFlag[ui] = pcFrom->m_pbSDCFlag[ui]; 576 567 #endif 577 #if LGE_INTER_SDC_E0156568 #if H_3D_INTER_SDC 578 569 m_pbInterSDCFlag[ui] = pcFrom->m_pbInterSDCFlag[ui]; 579 570 #endif … … 631 622 memset( m_dmmWedgeTabIdx[i] + firstElement, 0, numElements * sizeof( *m_dmmWedgeTabIdx[i] ) ); 632 623 } 633 #if !SEC_DMM2_E0146_HHIFIX634 memset( m_dmm2DeltaEnd + firstElement, 0, numElements * sizeof( *m_dmm2DeltaEnd ) );635 #endif636 624 memset( m_dmm3IntraTabIdx + firstElement, 0, numElements * sizeof( *m_dmm3IntraTabIdx ) ); 637 625 #endif … … 649 637 #endif 650 638 #endif 651 #if LGE_INTER_SDC_E0156639 #if H_3D_INTER_SDC 652 640 memset( m_pbInterSDCFlag + firstElement, 0, numElements * sizeof( *m_pbInterSDCFlag ) ); 653 641 for( Int i = 0; i < 4; i++ ) … … 811 799 m_dmmWedgeTabIdx[i] [ui] = 0; 812 800 } 813 #if !SEC_DMM2_E0146_HHIFIX814 m_dmm2DeltaEnd [ui] = 0;815 #endif816 801 m_dmm3IntraTabIdx [ui] = 0; 817 802 #endif … … 822 807 #endif 823 808 #endif 824 #if LGE_INTER_SDC_E0156809 #if H_3D_INTER_SDC 825 810 m_pbInterSDCFlag[ui] = false; 826 811 for( Int i = 0; i < 4; i++ ) … … 925 910 memset( m_dmmWedgeTabIdx[i], 0, sizeof(UInt) * m_uiNumPartition ); 926 911 } 927 #if !SEC_DMM2_E0146_HHIFIX928 memset( m_dmm2DeltaEnd , 0, sizeof(Int ) * m_uiNumPartition );929 #endif930 912 memset( m_dmm3IntraTabIdx, 0, sizeof(UInt) * m_uiNumPartition ); 931 913 #endif … … 943 925 #endif 944 926 #endif 945 #if LGE_INTER_SDC_E0156927 #if H_3D_INTER_SDC 946 928 memset( m_pbInterSDCFlag, 0, sizeof( Bool ) * m_uiNumPartition ); 947 929 for( Int i = 0; i < 4; i++ ) … … 1010 992 m_dmmWedgeTabIdx[i] [ui] = pcCU->m_dmmWedgeTabIdx[i] [uiPartOffset+ui]; 1011 993 } 1012 #if !SEC_DMM2_E0146_HHIFIX1013 m_dmm2DeltaEnd [ui] = pcCU->m_dmm2DeltaEnd [uiPartOffset+ui];1014 #endif1015 994 m_dmm3IntraTabIdx [ui] = pcCU->m_dmm3IntraTabIdx[uiPartOffset+ui]; 1016 995 #endif … … 1021 1000 #endif 1022 1001 #endif 1023 #if LGE_INTER_SDC_E01561002 #if H_3D_INTER_SDC 1024 1003 m_pbInterSDCFlag [ui] = pcCU->m_pbInterSDCFlag [ uiPartOffset + ui ]; 1025 1004 for( Int i = 0; i < 4; i++ ) … … 1167 1146 m_dmmWedgeTabIdx[i] = pcCU->getDmmWedgeTabIdx( i ) + uiPart; 1168 1147 } 1169 #if !SEC_DMM2_E0146_HHIFIX1170 m_dmm2DeltaEnd = pcCU->getDmm2DeltaEnd() + uiPart;1171 #endif1172 1148 m_dmm3IntraTabIdx = pcCU->getDmm3IntraTabIdx() + uiPart; 1173 1149 #endif … … 1185 1161 #endif 1186 1162 #endif 1187 #if LGE_INTER_SDC_E01561163 #if H_3D_INTER_SDC 1188 1164 m_pbInterSDCFlag = pcCU->getInterSDCFlag() + uiPart; 1189 1165 for( Int i = 0; i < 4; i++ ) … … 1366 1342 memcpy( m_dmmWedgeTabIdx[i] + uiOffset, pcCU->getDmmWedgeTabIdx( i ), sizeof(UInt) * uiNumPartition ); 1367 1343 } 1368 #if !SEC_DMM2_E0146_HHIFIX1369 memcpy( m_dmm2DeltaEnd + uiOffset, pcCU->getDmm2DeltaEnd() , sizeof(Int ) * uiNumPartition );1370 #endif1371 1344 memcpy( m_dmm3IntraTabIdx + uiOffset, pcCU->getDmm3IntraTabIdx(), sizeof(UInt) * uiNumPartition ); 1372 1345 #endif … … 1384 1357 #endif 1385 1358 #endif 1386 #if LGE_INTER_SDC_E01561359 #if H_3D_INTER_SDC 1387 1360 memcpy( m_pbInterSDCFlag + uiOffset, pcCU->getInterSDCFlag(), iSizeInBool ); 1388 1361 for( Int i = 0; i < 4; i++ ) … … 1496 1469 memcpy( rpcCU->getDmmWedgeTabIdx( i ) + m_uiAbsIdxInLCU, m_dmmWedgeTabIdx[i], sizeof(UInt) * m_uiNumPartition ); 1497 1470 } 1498 #if !SEC_DMM2_E0146_HHIFIX1499 memcpy( rpcCU->getDmm2DeltaEnd() + m_uiAbsIdxInLCU, m_dmm2DeltaEnd , sizeof(Int ) * m_uiNumPartition );1500 #endif1501 1471 memcpy( rpcCU->getDmm3IntraTabIdx() + m_uiAbsIdxInLCU, m_dmm3IntraTabIdx, sizeof(UInt) * m_uiNumPartition ); 1502 1472 #endif … … 1514 1484 #endif 1515 1485 #endif 1516 #if LGE_INTER_SDC_E01561486 #if H_3D_INTER_SDC 1517 1487 memcpy( rpcCU->getInterSDCFlag() + m_uiAbsIdxInLCU, m_pbInterSDCFlag, iSizeInBool ); 1518 1488 for( Int i = 0;i < 4; i++ ) … … 1612 1582 memcpy( rpcCU->getDmmWedgeTabIdx( i ) + uiPartOffset, m_dmmWedgeTabIdx[i], sizeof(UInt) * uiQNumPart ); 1613 1583 } 1614 #if !SEC_DMM2_E0146_HHIFIX1615 memcpy( rpcCU->getDmm2DeltaEnd() + uiPartOffset, m_dmm2DeltaEnd , sizeof(Int ) * uiQNumPart );1616 #endif1617 1584 memcpy( rpcCU->getDmm3IntraTabIdx() + uiPartOffset, m_dmm3IntraTabIdx, sizeof(UInt) * uiQNumPart ); 1618 1585 #endif … … 1630 1597 #endif 1631 1598 #endif 1632 #if LGE_INTER_SDC_E01561599 #if H_3D_INTER_SDC 1633 1600 memcpy( rpcCU->getInterSDCFlag() + uiPartOffset, m_pbInterSDCFlag, iSizeInBool ); 1634 1601 for( Int i = 0; i < 4; i++ ) … … 2351 2318 #endif 2352 2319 2353 #if LGE_INTER_SDC_E01562320 #if H_3D_INTER_SDC 2354 2321 Void TComDataCU::setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2355 2322 { … … 2689 2656 // check prediction mode 2690 2657 UInt uiLumaPredMode = getLumaIntraDir( uiAbsPartIdx ); 2691 #if LGE_SDC_REMOVE_DC_E01582692 2658 if( uiLumaPredMode == PLANAR_IDX || ( getDimType( uiLumaPredMode ) == DMM1_IDX && !isDimDeltaDC( uiLumaPredMode ) ) ) 2693 #else2694 if( uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX || ( getDimType( uiLumaPredMode ) == DMM1_IDX && !isDimDeltaDC( uiLumaPredMode ) ) )2695 #endif2696 2659 return true; 2697 2660 … … 3569 3532 UInt uiPartIdxCenter; 3570 3533 xDeriveCenterIdx( uiPUIdx, uiPartIdxCenter ); 3534 #if H_3D_FCO 3535 TComPic * pcTexturePic = m_pcSlice->getTexturePic(); 3536 TComDataCU *pcTextureCU = 0; 3537 if ( pcTexturePic ) 3538 pcTextureCU = pcTexturePic->getCU( getAddr() ); 3539 #else 3571 3540 TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() ); 3541 #endif 3572 3542 3543 #if H_3D_FCO 3544 if ( pcTextureCU && pcTexturePic->getReconMark() && !pcTextureCU->isIntra( uiPartIdxCenter ) ) 3545 #else 3573 3546 if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdxCenter ) ) 3547 #endif 3574 3548 { 3575 3549 pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); … … 4830 4804 4831 4805 // use coldir. 4832 #if H_MV54833 4806 TComPic *pColPic = getSlice()->getRefPic( RefPicList(getSlice()->isInterB() ? 1-getSlice()->getColFromL0Flag() : 0), getSlice()->getColRefIdx()); 4834 #else4835 #if H_MV4836 TComPic *pColPic;4837 if (getSlice()->getAltCollocatedIndicationFlag() )4838 {4839 pColPic = getSlice()->getPicFromRefPicSetInterLayer( getSlice()->getActiveMotionPredRefLayerId( getSlice()->getCollocatedRefLayerIdx() ));4840 }4841 else4842 {4843 pColPic = getSlice()->getRefPic( RefPicList(getSlice()->isInterB() ? 1-getSlice()->getColFromL0Flag() : 0), getSlice()->getColRefIdx());4844 }4845 #else4846 TComPic *pColPic = getSlice()->getRefPic( RefPicList(getSlice()->isInterB() ? 1-getSlice()->getColFromL0Flag() : 0), getSlice()->getColRefIdx());4847 #endif4848 #endif4849 4807 TComDataCU *pColCU = pColPic->getCU( uiCUAddr ); 4850 4808 if(pColCU->getPic()==0||pColCU->getPartitionSize(uiPartUnitIdx)==SIZE_NONE) … … 4996 4954 + ( iPartWidth/m_pcPic->getMinCUWidth() )/2]; 4997 4955 } 4998 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E01704999 Void TComDataCU::compressMV( int scale)4956 #if H_3D 4957 Void TComDataCU::compressMV(Int scale) 5000 4958 #else 5001 4959 Void TComDataCU::compressMV() 5002 4960 #endif 5003 4961 { 5004 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E01704962 #if H_3D 5005 4963 Int scaleFactor = (4 / scale ) * AMVP_DECIMATION_FACTOR / m_unitSize; 5006 4964 #else … … 5509 5467 xDeriveCenterIdx(uiPartIdx, uiPartIdxCenter ); 5510 5468 5511 ///*** Derive bottom right neighbour position ***5512 #if !SEC_SIMPLIFIED_NBDV_E01425513 Int iLCUIdxRBNb = -1;5514 Int iPartIdxRBNb = -1;5515 xDeriveRightBottomNbIdx(iLCUIdxRBNb, iPartIdxRBNb );5516 #endif5517 5518 5469 ///*** Search temporal candidate pictures for disparity vector *** 5519 5470 const Int iNumCandPics = getPic()->getNumDdvCandPics(); … … 5533 5484 } 5534 5485 5535 #if !SEC_SIMPLIFIED_NBDV_E0142 5536 // Check BR and Center 5537 for(Int curPosition = 0; curPosition < 2; curPosition++) 5538 { 5539 #endif 5540 Bool bCheck = false; 5541 #if !SEC_SIMPLIFIED_NBDV_E0142 5542 if ( curPosition == 0 && iLCUIdxRBNb >= 0 ) 5543 #if MTK_NBDV_TN_FIX_E0172 5544 bCheck = xGetColDisMV( curCandPic, eCurRefPicList, curCandPicRefIdx, iLCUIdxRBNb, iPartIdxRBNb, cColMv, iTargetViewIdx, iTStartViewIdx); 5486 Bool bCheck = xGetColDisMV( curCandPic, eCurRefPicList, curCandPicRefIdx, uiLCUIdx, uiPartIdxCenter, cColMv, iTargetViewIdx, iTStartViewIdx ); 5487 5488 if( bCheck ) 5489 { 5490 clipMv(cColMv); 5491 pDInfo->m_acNBDV = cColMv; 5492 pDInfo->m_aVIdxCan = iTargetViewIdx; 5493 5494 #if H_3D_NBDV_REF 5495 TComPic* picDepth = NULL; 5496 #if H_3D_FCO_VSP_DONBDV_E0163 5497 picDepth = getSlice()->getIvPic(true, getSlice()->getViewIndex() ); 5498 if ( picDepth->getPicYuvRec() != NULL ) 5499 { 5500 cColMv.setZero(); 5501 } 5502 else // Go back with virtual depth 5503 { 5504 picDepth = getSlice()->getIvPic( true, iTargetViewIdx ); 5505 } 5506 5507 assert(picDepth != NULL); 5545 5508 #else 5546 bCheck = xGetColDisMV( eCurRefPicList, curCandPicRefIdx, iLCUIdxRBNb, iPartIdxRBNb, cColMv, iTargetViewIdx, iTStartViewIdx); 5547 #endif 5548 5549 if (curPosition == 1 ) 5550 #endif 5551 #if MTK_NBDV_TN_FIX_E0172 5552 bCheck = xGetColDisMV( curCandPic, eCurRefPicList, curCandPicRefIdx, uiLCUIdx, uiPartIdxCenter, cColMv, iTargetViewIdx, iTStartViewIdx ); 5553 #else 5554 bCheck = xGetColDisMV( eCurRefPicList, curCandPicRefIdx, uiLCUIdx, uiPartIdxCenter, cColMv, iTargetViewIdx, iTStartViewIdx ); 5555 #endif 5556 5557 if( bCheck ) 5558 { 5559 clipMv(cColMv); 5560 pDInfo->m_acNBDV = cColMv; 5561 pDInfo->m_aVIdxCan = iTargetViewIdx; 5562 5563 #if H_3D_NBDV_REF 5564 TComPic* picDepth = NULL; 5565 picDepth = getSlice()->getIvPic( true, iTargetViewIdx ); 5566 assert(picDepth != NULL); 5567 if (picDepth && bDepthRefine) 5568 estimateDVFromDM(iTargetViewIdx, uiPartIdx, picDepth, uiPartAddr, &cColMv ); 5569 5570 pDInfo->m_acDoNBDV = cColMv; 5509 picDepth = getSlice()->getIvPic( true, iTargetViewIdx ); 5510 assert(picDepth != NULL); 5511 #endif 5512 if (picDepth && bDepthRefine) 5513 estimateDVFromDM(iTargetViewIdx, uiPartIdx, picDepth, uiPartAddr, &cColMv ); 5514 5515 pDInfo->m_acDoNBDV = cColMv; 5571 5516 #endif //H_3D_NBDV_REF 5572 return true; 5573 } 5574 #if !SEC_SIMPLIFIED_NBDV_E0142 5575 } 5576 #endif 5517 return true; 5518 } 5577 5519 } 5578 5520 } … … 5587 5529 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_LEFT 5588 5530 #if H_3D_NBDV_REF 5589 , bDepthRefine5531 , bDepthRefine 5590 5532 #endif 5591 5533 ) ) … … 5599 5541 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_ABOVE 5600 5542 #if H_3D_NBDV_REF 5601 , bDepthRefine5602 #endif 5603 ) )5543 , bDepthRefine 5544 #endif 5545 ) ) 5604 5546 return true; 5605 5547 } 5606 5607 #if !SEC_SIMPLIFIED_NBDV_E01425608 //// ******* Get disparity from above right block ******* /////5609 pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true);5610 if(pcTmpCU != NULL )5611 {5612 bCheckMcpDv = ( ( getAddr() - pcTmpCU->getAddr() ) == 0);5613 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_ABOVERIGHT5614 #if H_3D_NBDV_REF5615 , bDepthRefine5616 #endif5617 ) )5618 return true;5619 }5620 5621 //// ******* Get disparity from below left block ******* /////5622 pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB, true);5623 if( pcTmpCU != NULL )5624 {5625 bCheckMcpDv = true;5626 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_LEFTBELOW5627 #if H_3D_NBDV_REF5628 , bDepthRefine5629 #endif5630 ) )5631 return true;5632 }5633 5634 //// ******* Get disparity from above left block ******* /////5635 pcTmpCU = getPUAboveLeft(uiIdx, (m_uiAbsIdxInLCU + uiPartAddr), true);5636 assert(uiPartIdxLT == (m_uiAbsIdxInLCU + uiPartAddr));5637 5638 if( pcTmpCU != NULL )5639 {5640 bCheckMcpDv = (( getAddr() - pcTmpCU->getAddr() ) <= 1);5641 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_ABOVELEFT5642 #if H_3D_NBDV_REF5643 , bDepthRefine5644 #endif5645 ) )5646 return true;5647 }5648 #endif5649 5548 5650 5549 //// ******* Search MCP blocks ******* ///// … … 5662 5561 pDInfo->m_aVIdxCan = cIDVInfo.m_aVIdxCan[iList][ curPos ]; 5663 5562 #if H_3D_NBDV_REF 5563 #if H_3D_FCO_VSP_DONBDV_E0163 5564 TComPic* picDepth = NULL; 5565 5566 picDepth = getSlice()->getIvPic(true, getSlice()->getViewIndex() ); 5567 if ( picDepth->getPicYuvRec() != NULL ) 5568 { 5569 cDispVec.setZero(); 5570 } 5571 else // Go back with virtual depth 5572 { 5573 picDepth = getSlice()->getIvPic( true, pDInfo->m_aVIdxCan ); 5574 } 5575 5576 assert(picDepth != NULL); 5577 #else 5664 5578 TComPic* picDepth = getSlice()->getIvPic( true, pDInfo->m_aVIdxCan ); 5665 5579 assert(picDepth!=NULL); 5580 #endif 5666 5581 5667 5582 if (picDepth && bDepthRefine) … … 5679 5594 TComMv defaultDV(0, 0); 5680 5595 pDInfo->m_acNBDV = defaultDV; 5681 #if NBDV_DEFAULT_VIEWIDX_BUGFIX 5596 5682 5597 Int valid = 0; 5683 5598 Int viewIndex = 0; … … 5707 5622 #if H_3D_NBDV_REF 5708 5623 TComPic* picDepth = NULL; 5624 #if H_3D_FCO_VSP_DONBDV_E0163 5625 picDepth = getSlice()->getIvPic(true, getSlice()->getViewIndex() ); 5626 if ( picDepth->getPicYuvRec() != NULL ) 5627 { 5628 defaultDV.setZero(); 5629 } 5630 else // Go back with virtual depth 5631 { 5632 picDepth = getSlice()->getIvPic( true, viewIndex ); 5633 } 5634 5635 assert(picDepth != NULL); 5636 #else 5709 5637 picDepth = getSlice()->getIvPic( true, viewIndex ); 5710 5638 assert(picDepth!=NULL); 5711 5639 #endif 5712 5640 if (picDepth && bDepthRefine) 5713 5641 { … … 5717 5645 #endif 5718 5646 } 5719 #else5720 pDInfo->m_aVIdxCan = 0;5721 #if H_3D_NBDV_REF5722 TComPic* picDepth = NULL;5723 picDepth = getSlice()->getIvPic( true, 0 );5724 assert(picDepth!=NULL);5725 5726 if (picDepth && bDepthRefine)5727 {5728 estimateDVFromDM(0, uiPartIdx, picDepth, uiPartAddr, &defaultDV ); // from base view5729 }5730 pDInfo->m_acDoNBDV = defaultDV;5731 #endif5732 #endif5733 5647 return false; 5734 5648 } … … 5740 5654 Int iPictureHeight = pcBaseViewDepthPicYuv->getHeight(); 5741 5655 5742 #if NTT_DoNBDV_VECTOR_CLIP_E01415743 5656 Int depthStartPosX = Clip3(0, iPictureWidth - 1, iBlkX + ((mv->getHor()+2)>>2)); 5744 5657 Int depthStartPosY = Clip3(0, iPictureHeight - 1, iBlkY + ((mv->getVer()+2)>>2)); 5745 5658 Int depthEndPosX = Clip3(0, iPictureWidth - 1, iBlkX + iBlkWidth - 1 + ((mv->getHor()+2)>>2)); 5746 5659 Int depthEndPosY = Clip3(0, iPictureHeight - 1, iBlkY + iBlkHeight - 1 + ((mv->getVer()+2)>>2)); 5747 #else5748 Int depthStartPosX = Clip3(0, iPictureWidth - iBlkWidth, iBlkX + ((mv->getHor()+2)>>2));5749 Int depthStartPosY = Clip3(0, iPictureHeight- iBlkHeight, iBlkY + ((mv->getVer()+2)>>2));5750 Int depthEndPosX = Clip3(0, iPictureWidth - 1, iBlkX + iBlkWidth - 1 + ((mv->getHor()+2)>>2));5751 Int depthEndPosY = Clip3(0, iPictureHeight - 1, iBlkY + iBlkHeight - 1 + ((mv->getVer()+2)>>2));5752 #endif5753 5660 5754 5661 Pel* depthTL = pcBaseViewDepthPicYuv->getLumaAddr(); … … 5812 5719 TComPic* picDepth = NULL; 5813 5720 assert(getSlice()->getRefPic(eRefPicList, refId)->getPOC() == getSlice()->getPOC()); 5721 #if H_3D_FCO_VSP_DONBDV_E0163 5722 picDepth = getSlice()->getIvPic(true, getSlice()->getViewIndex() ); 5723 if ( picDepth->getPicYuvRec() != NULL ) 5724 { 5725 cMvPred.setZero(); 5726 } 5727 else// Go back with virtual depth 5728 { 5729 picDepth = getSlice()->getIvPic (true, refViewIdx ); 5730 } 5731 assert(picDepth != NULL); 5732 #else 5814 5733 picDepth = getSlice()->getIvPic (true, refViewIdx ); 5815 5734 assert(picDepth != NULL); 5816 5735 #endif 5817 5736 UInt uiPartIdx = 0; //Notes from MTK: Please confirm that using 0 as partition index and partition address is correct for CU-level DoNBDV 5818 5737 UInt uiPartAddr = 0; //QC: confirmed … … 5829 5748 assert( uiMvpDvPos < IDV_CANDS ); 5830 5749 paIDVInfo->m_acMvCand[iList][ uiMvpDvPos ] = TComMv( cMvPred.getIDVHor(), cMvPred.getIDVVer() ); 5831 //Notes from QC: DvMCP is implemented in a way that doesn E½t carry the reference view identifier as NBDV. It only works for CTC and needs to be fixed to be aligned with other part of the NBDV design.5750 //Notes from QC: DvMCP is implemented in a way that doesnot carry the reference view identifier as NBDV. It only works for CTC and needs to be fixed to be aligned with other part of the NBDV design. 5832 5751 paIDVInfo->m_aVIdxCan[iList][ uiMvpDvPos ] = cMvPred.getIDVVId(); 5833 5752 paIDVInfo->m_bAvailab[iList][ uiMvpDvPos ] = true; … … 5901 5820 } 5902 5821 #endif 5903 #if MTK_NBDV_TN_FIX_E0172 5822 5904 5823 Bool TComDataCU::xGetColDisMV( Int currCandPic, RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv , Int & iTargetViewIdx, Int & iStartViewIdx ) 5905 #else5906 Bool TComDataCU::xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv , Int & iTargetViewIdx, Int & iStartViewIdx )5907 #endif5908 5824 { 5909 5825 … … 5921 5837 if(pColCU->getSlice()->isInterB()) 5922 5838 { 5923 5839 eColRefPicList = RefPicList(ilist); 5924 5840 } 5925 5841 … … 5939 5855 else 5940 5856 { 5941 #if MTK_NBDV_TN_FIX_E01725942 5857 if(getPic()->isTempIVRefValid(currCandPic, ilist, iColRefIdx)) 5943 5858 { 5944 #endif 5945 rcMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiPartUnitIdx); 5946 rcMv.setIDVFlag(0); 5947 iTargetViewIdx = iColRefViewIdx ; 5948 iStartViewIdx = iColViewIdx ; 5949 return true; 5950 #if MTK_NBDV_TN_FIX_E0172 5951 } 5952 #endif 5859 rcMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiPartUnitIdx); 5860 rcMv.setIDVFlag(0); 5861 iTargetViewIdx = iColRefViewIdx ; 5862 iStartViewIdx = iColViewIdx ; 5863 return true; 5864 } 5953 5865 } 5954 5866 } … … 5957 5869 } 5958 5870 #endif 5959 #if MTK_FAST_TEXTURE_ENCODING_E01735871 #if H_3D_FAST_TEXTURE_ENCODING 5960 5872 Void 5961 5873 TComDataCU::getIVNStatus ( UInt uiPartIdx, DisInfo* pDInfo, Bool& bIVFMerge, Int& iIVFMaxD) … … 6242 6154 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmmWedgeTabIdx[dmmType][uiAbsPartIdx+ui] = tabIdx; } 6243 6155 } 6244 #if !SEC_DMM2_E0146_HHIFIX6245 Void TComDataCU::setDmm2DeltaEndSubParts( Int iDelta, UInt uiAbsPartIdx, UInt uiDepth )6246 {6247 UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1);6248 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmm2DeltaEnd[uiAbsPartIdx+ui] = iDelta; }6249 }6250 #endif6251 6156 Void TComDataCU::setDmm3IntraTabIdxSubParts( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth ) 6252 6157 { -
TabularUnified trunk/source/Lib/TLibCommon/TComDataCU.h ¶
r622 r655 208 208 #if H_3D_DIM_DMM 209 209 UInt* m_dmmWedgeTabIdx[DMM_NUM_TYPE]; 210 #if !SEC_DMM2_E0146_HHIFIX211 Int* m_dmm2DeltaEnd;212 #endif213 210 UInt* m_dmm3IntraTabIdx; 214 211 #endif … … 225 222 #endif 226 223 #endif 227 #if LGE_INTER_SDC_E0156224 #if H_3D_INTER_SDC 228 225 Bool* m_pbInterSDCFlag; 229 226 Int* m_apSegmentInterDCOffset[4]; … … 489 486 #endif 490 487 ); 491 #if MTK_NBDV_TN_FIX_E0172492 488 Bool xGetColDisMV ( Int currCandPic, RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx ); 493 #else494 Bool xGetColDisMV ( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx );495 #endif496 489 Bool getDisMvpCandNBDV ( DisInfo* pDInfo 497 490 #if H_3D_NBDV_REF … … 505 498 #endif //H_3D_NBDV_REF 506 499 #endif 507 #if MTK_FAST_TEXTURE_ENCODING_E0173500 #if H_3D_FAST_TEXTURE_ENCODING 508 501 Void getIVNStatus ( UInt uiPartIdx, DisInfo* pDInfo, Bool& bIVFMerge, Int& iIVFMaxD); 509 502 #endif … … 545 538 Void setDmmWedgeTabIdxSubParts ( UInt tabIdx, UInt dmmType, UInt uiAbsPartIdx, UInt uiDepth ); 546 539 547 #if !SEC_DMM2_E0146_HHIFIX548 Int* getDmm2DeltaEnd () { return m_dmm2DeltaEnd; }549 Int getDmm2DeltaEnd ( UInt uiIdx ) { return m_dmm2DeltaEnd[uiIdx]; }550 Void setDmm2DeltaEnd ( UInt uiIdx, Int iD ) { m_dmm2DeltaEnd[uiIdx] = iD; }551 Void setDmm2DeltaEndSubParts ( Int iDelta, UInt uiAbsPartIdx, UInt uiDepth );552 #endif553 554 540 UInt* getDmm3IntraTabIdx () { return m_dmm3IntraTabIdx; } 555 541 UInt getDmm3IntraTabIdx ( UInt uiIdx ) { return m_dmm3IntraTabIdx[uiIdx]; } … … 588 574 #endif 589 575 #endif 590 #if LGE_INTER_SDC_E0156576 #if H_3D_INTER_SDC 591 577 Bool* getInterSDCFlag () { return m_pbInterSDCFlag; } 592 578 Bool getInterSDCFlag ( UInt uiIdx ) { return m_pbInterSDCFlag[uiIdx]; } … … 626 612 Void getMvPredAbove ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldB.getMv(); } 627 613 Void getMvPredAboveRight ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldC.getMv(); } 628 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170629 Void compressMV ( int scale);614 #if H_3D 615 Void compressMV ( Int scale ); 630 616 #else 631 617 Void compressMV (); -
TabularUnified trunk/source/Lib/TLibCommon/TComMv.h ¶
r622 r655 40 40 41 41 #include "CommonDef.h" 42 #include <cstdlib> 42 43 43 44 //! \ingroup TLibCommon -
TabularUnified trunk/source/Lib/TLibCommon/TComPattern.h ¶
r608 r655 102 102 Bool m_bICFlag; 103 103 #endif 104 #if LGE_INTER_SDC_E0156104 #if H_3D_INTER_SDC 105 105 Bool m_bSDCMRSADFlag; 106 106 #endif … … 119 119 Void setICFlag( Bool bICFlag ) { m_bICFlag = bICFlag; } 120 120 #endif 121 #if LGE_INTER_SDC_E0156121 #if H_3D_INTER_SDC 122 122 Bool getSDCMRSADFlag() { return m_bSDCMRSADFlag; } 123 123 Void setSDCMRSADFlag( Bool bSDCMRSADFlag ) { m_bSDCMRSADFlag = bSDCMRSADFlag; } -
TabularUnified trunk/source/Lib/TLibCommon/TComPic.cpp ¶
r608 r655 50 50 , m_bUsedByCurr (false) 51 51 , m_bIsLongTerm (false) 52 , m_bIsUsedAsLongTerm (false)53 52 , m_apcPicSym (NULL) 54 53 , m_pcPicYuvPred (NULL) … … 118 117 memcpy(m_numReorderPics, numReorderPics, MAX_TLAYER*sizeof(Int)); 119 118 119 /* initialize the texture to depth reference status */ 120 #if H_3D_FCO 121 for (int j=0; j<2; j++) 122 { 123 for (int i=0; i<MAX_NUM_REF; i++) 124 { 125 m_aiTexToDepRef[j][i] = -1; 126 } 127 } 128 #endif 129 120 130 return; 121 131 } … … 146 156 deleteSEIs(m_SEIs); 147 157 } 148 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170149 Void TComPic::compressMotion( int scale)158 #if H_3D 159 Void TComPic::compressMotion(Int scale) 150 160 #else 151 161 Void TComPic::compressMotion() … … 156 166 { 157 167 TComDataCU* pcCU = pPicSym->getCU(uiCUAddr); 158 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170168 #if H_3D 159 169 pcCU->compressMV(scale); 160 170 #else … … 661 671 return numDdvCandPics; 662 672 } 663 #endif 664 #if MTK_NBDV_TN_FIX_E0172 673 665 674 Void TComPic::checkTemporalIVRef() 666 675 { … … 716 725 return m_abTIVRINCurrRL[currCandPic][iColRefDir][iColRefIdx]; 717 726 } 718 #endif 719 #if MTK_TEXTURE_MRGCAND_BUGFIX_E0182 727 720 728 Void TComPic::checkTextureRef( ) 721 729 { 722 730 TComSlice* pcCurrSlice = getSlice(getCurrSliceIdx()); 723 731 TComPic* pcTextPic = pcCurrSlice->getTexturePic(); 732 #if H_3D_FCO 733 if ( pcTextPic ) 734 { 735 #endif 736 724 737 TComSlice* pcTextSlice = pcTextPic->getSlice(0); // currently only support single slice 725 738 … … 743 756 744 757 } 758 #if H_3D_FCO 759 } 760 #endif 761 745 762 } 746 763 -
TabularUnified trunk/source/Lib/TLibCommon/TComPic.h ¶
r608 r655 61 61 Bool m_bUsedByCurr; // Used by current picture 62 62 Bool m_bIsLongTerm; // IS long term picture 63 Bool m_bIsUsedAsLongTerm; // long term picture is used as reference before64 63 TComPicSym* m_apcPicSym; // Symbol 65 64 … … 83 82 Window m_defaultDisplayWindow; 84 83 84 bool m_isTop; 85 bool m_isField; 86 85 87 std::vector<std::vector<TComDataCU*> > m_vSliceCUDataLink; 86 88 … … 104 106 RefPicList m_eRapRefList; 105 107 Int m_iNumDdvCandPics; 106 #endif107 #if MTK_NBDV_TN_FIX_E0172108 108 Bool m_abTIVRINCurrRL [2][2][MAX_NUM_REF]; //whether an inter-view reference picture with the same view index of the inter-view reference picture of temporal reference picture of current picture exists in current reference picture lists 109 #endif110 #if MTK_TEXTURE_MRGCAND_BUGFIX_E0182111 109 Int m_aiTexToDepRef [2][MAX_NUM_REF]; 112 110 #endif … … 186 184 Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; } 187 185 Int getNumReorderPics(UInt tlayer) { return m_numReorderPics[tlayer]; } 188 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170189 Void compressMotion( int scale);186 #if H_3D 187 Void compressMotion(Int scale); 190 188 #else 191 189 Void compressMotion(); … … 212 210 TComPicYuv* getYuvPicBufferForIndependentBoundaryProcessing() {return m_pNDBFilterYuvTmp;} 213 211 std::vector<TComDataCU*>& getOneSliceCUDataForNDBFilter (Int sliceID) { return m_vSliceCUDataLink[sliceID];} 212 213 214 /* field coding parameters*/ 215 216 Void setTopField(bool b) {m_isTop = b;} 217 bool isTopField() {return m_isTop;} 218 Void setField(bool b) {m_isField = b;} 219 bool isField() {return m_isField;} 214 220 215 221 #if H_MV … … 224 230 UInt getRapRefIdx() {return m_uiRapRefIdx; } 225 231 RefPicList getRapRefList() {return m_eRapRefList; } 226 #endif 227 #if MTK_NBDV_TN_FIX_E0172 228 Void checkTemporalIVRef(); 229 Bool isTempIVRefValid(Int currCandPic, Int iTempRefDir, Int iTempRefIdx); 230 #endif 231 #if MTK_TEXTURE_MRGCAND_BUGFIX_E0182 232 Void checkTextureRef( ); 233 Int isTextRefValid(Int iTextRefDir, Int iTextRefIdx); 232 Void checkTemporalIVRef(); 233 Bool isTempIVRefValid(Int currCandPic, Int iTempRefDir, Int iTempRefIdx); 234 Void checkTextureRef( ); 235 Int isTextRefValid(Int iTextRefDir, Int iTextRefIdx); 234 236 #endif 235 237 /** transfer ownership of seis to this picture */ -
TabularUnified trunk/source/Lib/TLibCommon/TComPicSym.cpp ¶
r608 r655 61 61 ,m_uiNumAllocatedSlice (0) 62 62 ,m_apcTComDataCU (NULL) 63 ,m_iTileBoundaryIndependenceIdr (0)64 63 ,m_iNumColumnsMinus1 (0) 65 64 ,m_iNumRowsMinus1(0) -
TabularUnified trunk/source/Lib/TLibCommon/TComPicSym.h ¶
r608 r655 99 99 UInt m_uiNumAllocatedSlice; 100 100 TComDataCU** m_apcTComDataCU; ///< array of CU data 101 102 Int m_iTileBoundaryIndependenceIdr; 101 103 102 Int m_iNumColumnsMinus1; 104 103 Int m_iNumRowsMinus1; -
TabularUnified trunk/source/Lib/TLibCommon/TComPrediction.cpp ¶
r622 r655 39 39 #include "TComPrediction.h" 40 40 41 #if SHARP_ILLUCOMP_REFINE_E004642 #define IC_REG_COST_SHIFT 743 #define IC_CONST_SHIFT 544 #define IC_SHIFT_DIFF 1245 #endif46 47 41 //! \ingroup TLibCommon 48 42 //! \{ … … 69 63 if (m_pDepthBlock != NULL) 70 64 free(m_pDepthBlock); 71 #if NTT_VSP_COMMON_E0207_E020872 65 m_cYuvDepthOnVsp.destroy(); 73 #endif74 66 #endif 75 67 … … 129 121 m_acYuvPredBase[1] .create( g_uiMaxCUWidth, g_uiMaxCUHeight ); 130 122 #endif 131 #if NTT_VSP_COMMON_E0207_E0208123 #if H_3D_VSP 132 124 m_cYuvDepthOnVsp.create( g_uiMaxCUWidth, g_uiMaxCUHeight ); 133 125 #endif … … 143 135 } 144 136 #if H_3D_IC 145 #if SHARP_ILLUCOMP_REFINE_E0046146 137 m_uiaShift[0] = 0; 147 138 for( Int i = 1; i < 64; i++ ) … … 149 140 m_uiaShift[i] = ( (1 << 15) + i/2 ) / i; 150 141 } 151 #else152 for( Int i = 1; i < 64; i++ )153 {154 m_uiaShift[i-1] = ( (1 << 15) + i/2 ) / i;155 }156 #endif157 142 #endif 158 143 } … … 456 441 dmmSegmentation = &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]); 457 442 } break; 458 #if !SEC_DMM2_E0146_HHIFIX459 case( DMM2_IDX ):460 {461 UInt uiTabIdx = 0;462 if( bFastEnc ) { uiTabIdx = pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ); }463 else464 {465 uiTabIdx = xPredWedgeFromIntra( pcCU, uiAbsPartIdx, iWidth, iHeight, pcCU->getDmm2DeltaEnd( uiAbsPartIdx ) );466 pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dimType, uiAbsPartIdx, (pcCU->getDepth(0) + (pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1)) );467 }468 dmmSegmentation = &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ uiTabIdx ]);469 } break;470 #endif471 443 case( DMM3_IDX ): 472 444 { … … 709 681 #endif 710 682 , bICFlag ); 711 #if SHARP_ILLUCOMP_REFINE_E0046712 683 bICFlag = bICFlag && (iWidth > 8); 713 #endif714 684 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi 715 685 #if H_3D_ARP … … 731 701 // Get depth reference 732 702 Int depthRefViewIdx = pcCU->getDvInfo(uiPartAddr).m_aVIdxCan; 703 #if H_3D_FCO_VSP_DONBDV_E0163 704 TComPic* pRefPicBaseDepth = 0; 705 Bool bIsCurrDepthCoded = false; 706 pRefPicBaseDepth = pcCU->getSlice()->getIvPic( true, pcCU->getSlice()->getViewIndex() ); 707 if ( pRefPicBaseDepth->getPicYuvRec() != NULL ) 708 { 709 bIsCurrDepthCoded = true; 710 } 711 else 712 { 713 pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx ); 714 } 715 #else 733 716 TComPic* pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx ); 717 #endif 734 718 assert(pRefPicBaseDepth != NULL); 735 719 TComPicYuv* pcBaseViewDepthPicYuv = pRefPicBaseDepth->getPicYuvRec(); … … 752 736 pcCU->clipMv(cDv); 753 737 754 #if NTT_VSP_COMMON_E0207_E0208 738 #if H_3D_FCO_VSP_DONBDV_E0163 739 if ( bIsCurrDepthCoded ) 740 { 741 cDv.setZero(); 742 } 743 #endif 755 744 // fetch virtual depth map 756 #if NTT_VSP_VECTOR_CLIP_E0208757 745 pcBaseViewDepthPicYuv->extendPicBorder(); 758 #endif759 746 xGetVirtualDepth( pcCU, pcBaseViewDepthPicYuv, &cDv, uiPartAddr, iWidth, iHeight, &m_cYuvDepthOnVsp ); 760 747 // sub-PU based compensation 761 748 xPredInterLumaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi ); 762 749 xPredInterChromaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi ); 763 #else764 UInt uiAbsPartIdx = pcCU->getZorderIdxInCU();765 Int iBlkX = ( pcCU->getAddr() % pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ];766 Int iBlkY = ( pcCU->getAddr() / pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ];767 xPredInterLumaBlkFromDM ( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, &cDv, uiPartAddr, iBlkX, iBlkY, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );768 xPredInterChromaBlkFromDM( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, &cDv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );769 #endif770 771 750 } 772 751 #endif … … 984 963 if ( yFrac == 0 ) 985 964 { 986 #if MTK_CLIPPING_ALIGN_IC_E0168965 #if H_3D_IC 987 966 m_if.filterHorLuma( ref, refStride, dst, dstStride, width, height, xFrac, !bi || bICFlag 988 967 #else … … 996 975 else if ( xFrac == 0 ) 997 976 { 998 #if MTK_CLIPPING_ALIGN_IC_E0168977 #if H_3D_IC 999 978 m_if.filterVerLuma( ref, refStride, dst, dstStride, width, height, yFrac, true, !bi || bICFlag 1000 979 #else … … 1019 998 #endif 1020 999 ); 1021 #if MTK_CLIPPING_ALIGN_IC_E01681000 #if H_3D_IC 1022 1001 m_if.filterVerLuma(tmp + (halfFilterSize-1)*tmpStride, tmpStride, dst, dstStride, width, height, yFrac, false, !bi || bICFlag 1023 1002 #else … … 1033 1012 if( bICFlag ) 1034 1013 { 1035 #if SHARP_ILLUCOMP_REFINE_E00461036 1014 Int a, b, i, j; 1037 1015 const Int iShift = IC_CONST_SHIFT; 1038 1016 1039 1017 xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_LUMA ); 1040 #else1041 Int a, b, iShift, i, j;1042 1043 xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_LUMA );1044 #endif1045 1018 1046 1019 … … 1049 1022 for ( j = 0; j < width; j++ ) 1050 1023 { 1051 #if !MTK_CLIPPING_ALIGN_IC_E01681052 if( bi )1053 {1054 Int iIFshift = IF_INTERNAL_PREC - g_bitDepthY;1055 dst[j] = ( ( a*dst[j] + a*IF_INTERNAL_OFFS ) >> iShift ) + b*( 1 << iIFshift ) - IF_INTERNAL_OFFS;1056 }1057 else1058 #endif1059 1024 dst[j] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, ( ( a*dst[j] ) >> iShift ) + b ); 1060 1025 } 1061 1026 dst += dstStride; 1062 1027 } 1063 #if MTK_CLIPPING_ALIGN_IC_E0168 1028 1064 1029 if(bi) 1065 1030 { … … 1076 1041 } 1077 1042 } 1078 #endif1079 1043 } 1080 1044 #endif … … 1127 1091 if ( yFrac == 0 ) 1128 1092 { 1129 #if MTK_CLIPPING_ALIGN_IC_E01681093 #if H_3D_IC 1130 1094 m_if.filterHorChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag 1131 1095 #else … … 1136 1100 #endif 1137 1101 ); 1138 #if MTK_CLIPPING_ALIGN_IC_E01681102 #if H_3D_IC 1139 1103 m_if.filterHorChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag 1140 1104 #else … … 1148 1112 else if ( xFrac == 0 ) 1149 1113 { 1150 #if MTK_CLIPPING_ALIGN_IC_E01681114 #if H_3D_IC 1151 1115 m_if.filterVerChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag 1152 1116 #else … … 1157 1121 #endif 1158 1122 ); 1159 #if MTK_CLIPPING_ALIGN_IC_E01681123 #if H_3D_IC 1160 1124 m_if.filterVerChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag 1161 1125 #else … … 1174 1138 #endif 1175 1139 ); 1176 #if MTK_CLIPPING_ALIGN_IC_E01681140 #if H_3D_IC 1177 1141 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCb, dstStride, cxWidth, cxHeight , yFrac, false, !bi || bICFlag 1178 1142 #else … … 1189 1153 #endif 1190 1154 ); 1191 #if MTK_CLIPPING_ALIGN_IC_E01681155 #if H_3D_IC 1192 1156 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight , yFrac, false, !bi || bICFlag 1193 1157 #else … … 1203 1167 if( bICFlag ) 1204 1168 { 1205 #if SHARP_ILLUCOMP_REFINE_E00461206 1169 Int a, b, i, j; 1207 1170 const Int iShift = IC_CONST_SHIFT; 1208 1171 xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_CHROMA_U ); // Cb 1209 #else1210 Int a, b, iShift, i, j;1211 xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_CHROMA_U ); // Cb1212 #endif1213 1172 for ( i = 0; i < cxHeight; i++ ) 1214 1173 { 1215 1174 for ( j = 0; j < cxWidth; j++ ) 1216 1175 { 1217 #if !MTK_CLIPPING_ALIGN_IC_E01681218 if( bi )1219 {1220 Int iIFshift = IF_INTERNAL_PREC - g_bitDepthC;1221 dstCb[j] = ( ( a*dstCb[j] + a*IF_INTERNAL_OFFS ) >> iShift ) + b*( 1<<iIFshift ) - IF_INTERNAL_OFFS;1222 }1223 else1224 #endif1225 1176 dstCb[j] = Clip3( 0, ( 1 << g_bitDepthC ) - 1, ( ( a*dstCb[j] ) >> iShift ) + b ); 1226 1177 } 1227 1178 dstCb += dstStride; 1228 1179 } 1229 #if SHARP_ILLUCOMP_REFINE_E00461230 1180 xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_CHROMA_V ); // Cr 1231 #else1232 xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_CHROMA_V ); // Cr1233 #endif1234 1181 for ( i = 0; i < cxHeight; i++ ) 1235 1182 { 1236 1183 for ( j = 0; j < cxWidth; j++ ) 1237 1184 { 1238 #if !MTK_CLIPPING_ALIGN_IC_E01681239 if( bi )1240 {1241 Int iIFshift = IF_INTERNAL_PREC - g_bitDepthC;1242 dstCr[j] = ( ( a*dstCr[j] + a*IF_INTERNAL_OFFS ) >> iShift ) + b*( 1<<iIFshift ) - IF_INTERNAL_OFFS;1243 }1244 else1245 #endif1246 1185 dstCr[j] = Clip3( 0, ( 1 << g_bitDepthC ) - 1, ( ( a*dstCr[j] ) >> iShift ) + b ); 1247 1186 } 1248 1187 dstCr += dstStride; 1249 1188 } 1250 #if MTK_CLIPPING_ALIGN_IC_E0168 1189 1251 1190 if(bi) 1252 1191 { … … 1268 1207 } 1269 1208 } 1270 #endif1271 1209 } 1272 1210 #endif … … 1323 1261 Int k, l, bottomLeft, topRight; 1324 1262 Int horPred; 1325 Int leftColumn[MAX_CU_SIZE ], topRow[MAX_CU_SIZE], bottomRow[MAX_CU_SIZE], rightColumn[MAX_CU_SIZE];1263 Int leftColumn[MAX_CU_SIZE+1], topRow[MAX_CU_SIZE+1], bottomRow[MAX_CU_SIZE], rightColumn[MAX_CU_SIZE]; 1326 1264 UInt blkSize = width; 1327 1265 UInt offset2D = width; … … 1417 1355 } 1418 1356 1419 #if !SHARP_ILLUCOMP_REFINE_E00461420 /** Function for counting leading number of zeros/ones1421 * \param x input value1422 \ This function counts leading number of zeros for positive numbers and1423 \ leading number of ones for negative numbers. This can be implemented in1424 \ single instructure cycle on many processors.1425 */1426 1427 Short CountLeadingZerosOnes (Short x)1428 {1429 Short clz;1430 Short i;1431 1432 if(x == 0)1433 {1434 clz = 0;1435 }1436 else1437 {1438 if (x == -1)1439 {1440 clz = 15;1441 }1442 else1443 {1444 if(x < 0)1445 {1446 x = ~x;1447 }1448 clz = 15;1449 for(i = 0;i < 15;++i)1450 {1451 if(x)1452 {1453 clz --;1454 }1455 x = x >> 1;1456 }1457 }1458 }1459 return clz;1460 }1461 #endif1462 1357 1463 1358 /** Function for deriving LM illumination compensation. 1464 1359 */ 1465 #if SHARP_ILLUCOMP_REFINE_E00461466 1360 Void TComPrediction::xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, TextType eType ) 1467 #else1468 Void TComPrediction::xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift, TextType eType )1469 #endif1470 1361 { 1471 1362 TComPicYuv *pRecPic = pcCU->getPic()->getPicYuvRec(); … … 1495 1386 1496 1387 Int x = 0, y = 0, xx = 0, xy = 0; 1497 #if SHARP_ILLUCOMP_REFINE_E00461498 1388 Int precShift = std::max(0, (( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC) - 12); 1499 #endif1500 1389 1501 1390 if( pcCU->getPUAbove( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) && iCUPelY > 0 && iRefY > 0 ) … … 1519 1408 } 1520 1409 1521 #if SHARP_ILLUCOMP_REFINE_E00461522 1410 for( j = 0; j < uiWidth; j+=2 ) 1523 #else1524 for( j = 0; j < uiWidth; j++ )1525 #endif1526 1411 { 1527 1412 x += pRef[j]; 1528 1413 y += pRec[j]; 1529 #if SHARP_ILLUCOMP_REFINE_E00461530 1414 xx += (pRef[j] * pRef[j])>>precShift; 1531 1415 xy += (pRef[j] * pRec[j])>>precShift; 1532 #else 1533 xx += pRef[j] * pRef[j]; 1534 xy += pRef[j] * pRec[j]; 1535 #endif 1536 } 1537 #if SHARP_ILLUCOMP_REFINE_E0046 1416 } 1538 1417 iCountShift += g_aucConvertToBit[ uiWidth ] + 1; 1539 #else1540 iCountShift += g_aucConvertToBit[ uiWidth ] + 2;1541 #endif1542 1418 } 1543 1419 … … 1563 1439 } 1564 1440 1565 #if SHARP_ILLUCOMP_REFINE_E00461566 1441 for( i = 0; i < uiHeight; i+=2 ) 1567 #else1568 for( i = 0; i < uiHeight; i++ )1569 #endif1570 1442 { 1571 1443 x += pRef[0]; 1572 1444 y += pRec[0]; 1573 #if SHARP_ILLUCOMP_REFINE_E0046 1445 1574 1446 xx += (pRef[0] * pRef[0])>>precShift; 1575 1447 xy += (pRef[0] * pRec[0])>>precShift; … … 1577 1449 pRef += iRefStride*2; 1578 1450 pRec += iRecStride*2; 1579 #else 1580 xx += pRef[0] * pRef[0]; 1581 xy += pRef[0] * pRec[0]; 1582 1583 pRef += iRefStride; 1584 pRec += iRecStride; 1585 #endif 1586 } 1587 #if SHARP_ILLUCOMP_REFINE_E0046 1451 } 1588 1452 iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 1 ); 1589 #else 1590 iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 2 ); 1591 #endif 1592 } 1593 1594 #if SHARP_ILLUCOMP_REFINE_E0046 1453 } 1454 1595 1455 xy += xx >> IC_REG_COST_SHIFT; 1596 1456 xx += xx >> IC_REG_COST_SHIFT; … … 1599 1459 const Int iShift = IC_CONST_SHIFT; 1600 1460 { 1601 #else1602 Int iTempShift = ( ( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC ) + g_aucConvertToBit[ uiWidth ] + 3 - 15;1603 1604 if( iTempShift > 0 )1605 {1606 x = ( x + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;1607 y = ( y + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;1608 xx = ( xx + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;1609 xy = ( xy + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;1610 iCountShift -= iTempShift;1611 }1612 1613 iShift = 13;1614 1615 if( iCountShift == 0 )1616 {1617 a = 1;1618 b = 0;1619 iShift = 0;1620 }1621 else1622 {1623 Int a1 = ( xy << iCountShift ) - y * x;1624 Int a2 = ( xx << iCountShift ) - x * x;1625 #endif1626 1461 { 1627 1462 const Int iShiftA2 = 6; 1628 #if !SHARP_ILLUCOMP_REFINE_E00461629 const Int iShiftA1 = 15;1630 #endif1631 1463 const Int iAccuracyShift = 15; 1632 1464 … … 1636 1468 Int a2s = a2; 1637 1469 1638 #if SHARP_ILLUCOMP_REFINE_E00461639 1470 a1 = Clip3(0, 2*a2, a1); 1640 1471 iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2; 1641 1472 iScaleShiftA1 = iScaleShiftA2 - IC_SHIFT_DIFF; 1642 #else1643 iScaleShiftA1 = GetMSB( abs( a1 ) ) - iShiftA1;1644 iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2;1645 #endif1646 1473 1647 1474 if( iScaleShiftA1 < 0 ) … … 1662 1489 a1s = a1 >> iScaleShiftA1; 1663 1490 1664 #if SHARP_ILLUCOMP_REFINE_E00461665 1491 a = a1s * m_uiaShift[ a2s ]; 1666 1492 a = a >> iScaleShiftA; 1667 #else1668 if (a2s >= 1)1669 {1670 a = a1s * m_uiaShift[ a2s - 1];1671 }1672 else1673 {1674 a = 0;1675 }1676 1677 if( iScaleShiftA < 0 )1678 {1679 a = a << -iScaleShiftA;1680 }1681 else1682 {1683 a = a >> iScaleShiftA;1684 }1685 1686 a = Clip3( -( 1 << 15 ), ( 1 << 15 ) - 1, a );1687 1688 Int minA = -(1 << (6));1689 Int maxA = (1 << 6) - 1;1690 if( a <= maxA && a >= minA )1691 {1692 // do nothing1693 }1694 else1695 {1696 Short n = CountLeadingZerosOnes( a );1697 a = a >> (9-n);1698 iShift -= (9-n);1699 }1700 #endif1701 1493 b = ( y - ( ( a * x ) >> iShift ) + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift; 1702 1494 } … … 1706 1498 1707 1499 #if H_3D_VSP 1708 1709 #if NTT_VSP_COMMON_E0207_E02081710 1500 // not fully support iRatioTxtPerDepth* != 1 1711 1501 Void TComPrediction::xGetVirtualDepth( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *mv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int ratioTxtPerDepthX, Int ratioTxtPerDepthY ) … … 1715 1505 1716 1506 Int refDepStride = picRefDepth->getStride(); 1717 1718 #if NTT_VSP_VECTOR_CLIP_E02081719 1507 1720 1508 Int refDepOffset = ( (mv->getHor()+2) >> 2 ) + ( (mv->getVer()+2) >> 2 ) * refDepStride; … … 1736 1524 refDepth += refDepOffset; 1737 1525 1738 #else // NTT_VSP_VECTOR_CLIP_E02081739 1740 Int widthDepth = picRefDepth->getWidth();1741 Int heightDepth = picRefDepth->getHeight();1742 Int posX, posY;1743 cu->getPic()->getPicYuvRec()->getTopLeftSamplePos( cu->getAddr(), cu->getZorderIdxInCU() + partAddr, posX, posY ); // top-left position in texture1744 posX /= ratioTxtPerDepthX; // texture position -> depth postion1745 posY /= ratioTxtPerDepthY;1746 1747 posX = Clip3(0, widthDepth-width, posX + ((mv->getHor()+2)>>2));1748 posY = Clip3(0, heightDepth-height, posY + ((mv->getVer()+2)>>2));1749 1750 Pel *refDepth = picRefDepth->getLumaAddr() + posX + posY * refDepStride;1751 1752 #endif // NTT_VSP_VECTOR_CLIP_E02081753 1754 1526 Int depStride = yuvDepth->getStride(); 1755 1527 Pel *depth = yuvDepth->getLumaAddr(); 1756 1757 #if NTT_VSP_ADAPTIVE_SPLIT_E02071758 1528 1759 1529 if( width<8 || height<8 ) … … 1894 1664 } 1895 1665 1896 #else // NTT_VSP_ADAPTIVE_SPLIT_E0207 1897 1898 Int rightOffset = nTxtPerDepthX - 1; 1899 Int depStrideBlock = depStride * nTxtPerDepthY; 1900 Int refDepStrideBlock = refDepStride * nTxtPerDepthY; 1901 Pel *refDepthTop = refDepth; 1902 Pel *refDepthBot = refDepthTop + (nTxtPerDepthY-1)*refDepStride; 1903 1904 for( Int y=0; y<height; y+= nTxtPerDepthY ) 1905 { 1906 for( Int x=0; x<width; x+=nTxtPerDepthX ) 1907 { 1908 Pel maxDepth = refDepthTop[x] > refDepthBot[x] ? refDepthTop[x] : refDepthBot[x]; 1909 1910 if( maxDepth < refDepthTop[x+rightOffset] ) 1911 { 1912 maxDepth = refDepthTop[x+rightOffset]; 1913 } 1914 if( maxDepth < refDepthBot[x+rightOffset] ) 1915 { 1916 maxDepth = refDepthBot[x+rightOffset]; 1917 } 1918 1919 depth[x] = maxDepth; 1920 1921 } 1922 refDepthTop += refDepStrideBlock; 1923 refDepthBot += refDepStrideBlock; 1924 depth += depStrideBlock; 1925 } 1926 1927 #endif // NTT_VSP_ADAPTIVE_SPLIT_E0207 1666 1928 1667 } 1929 1668 … … 1943 1682 Pel *dst = yuvDst->getLumaAddr(partAddr); 1944 1683 Pel *depth = yuvDepth->getLumaAddr(); 1945 1946 #if !(NTT_VSP_DC_BUGFIX_E0208)1947 Int widthLuma = picRef->getWidth();1948 Int posX, posY;1949 cu->getPic()->getPicYuvRec()->getTopLeftSamplePos( cu->getAddr(), cu->getZorderIdxInCU() + partAddr, posX, posY ); // top-left position in texture1950 #endif1951 1684 1952 1685 #if H_3D_VSP_BLOCKSIZE == 1 … … 2021 1754 Int xFrac = disparity & 0x3; 2022 1755 2023 #if NTT_VSP_DC_BUGFIX_E02082024 2025 1756 dv.setHor( disparity ); 2026 1757 cu->clipMv( dv ); … … 2038 1769 assert( ref[refOffset] >= 0 && ref[refOffset]<= 255 ); 2039 1770 m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi ); 2040 2041 #else // NTT_VSP_DC_BUGFIX_E02082042 2043 for( Int j=0; j < nTxtPerDepthX; j++ )2044 {2045 Int refOffset = xTxt+j + (disparity >> 2);2046 #if H_3D_VSP_CONSTRAINED2047 if(refOffset<minRelativePos || refOffset>maxRelativePos)2048 {2049 xFrac = 0;2050 }2051 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);2052 #endif2053 Int absX = posX + refOffset;2054 2055 if (xFrac == 0)2056 {2057 absX = Clip3(0, widthLuma-1, absX);2058 }2059 else2060 {2061 absX = Clip3(4, widthLuma-5, absX);2062 }2063 2064 refOffset = absX - posX;2065 assert( ref[refOffset] >= 0 && ref[refOffset] <= 255 );2066 2067 m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt+j], dstStride, 1, nTxtPerDepthY, xFrac, !isBi );2068 }2069 2070 #endif // NTT_VSP_DC_BUGFIX_E02082071 2072 1771 } 2073 1772 ref += refStrideBlock; … … 2101 1800 Pel *depth = yuvDepth->getLumaAddr(); 2102 1801 2103 #if !(NTT_VSP_DC_BUGFIX_E0208)2104 Int widthChroma = picRef->getWidth() >> 1;2105 Int posX, posY;2106 cu->getPic()->getPicYuvRec()->getTopLeftSamplePos( cu->getAddr(), cu->getZorderIdxInCU() + partAddr, posX, posY ); // top-left position in texture2107 posX >>= 1;2108 posY >>= 1;2109 #endif2110 2111 1802 #if H_3D_VSP_BLOCKSIZE == 1 2112 1803 #if H_3D_VSP_CONSTRAINED … … 2173 1864 Int xFrac = disparity & 0x7; 2174 1865 2175 #if NTT_VSP_DC_BUGFIX_E02082176 2177 1866 dv.setHor( disparity ); 2178 1867 cu->clipMv( dv ); … … 2193 1882 m_if.filterHorChroma( &refCb[refOffset], refStride, &dstCb[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi ); 2194 1883 m_if.filterHorChroma( &refCr[refOffset], refStride, &dstCr[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi ); 2195 2196 #else // NTT_VSP_DC_BUGFIX_E02082197 2198 for( Int j=0; j < nTxtPerDepthX; j++ )2199 {2200 Int refOffset = xTxt+j + (disparity >> 3);2201 #if H_3D_VSP_CONSTRAINED2202 if(refOffset<minRelativePos || refOffset>maxRelativePos)2203 {2204 xFrac = 0;2205 }2206 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);2207 #endif2208 Int absX = posX + refOffset;2209 2210 if (xFrac == 0)2211 {2212 absX = Clip3(0, widthChroma-1, absX);2213 }2214 else2215 {2216 absX = Clip3(4, widthChroma-5, absX);2217 }2218 2219 refOffset = absX - posX;2220 assert( refCb[refOffset] >= 0 && refCb[refOffset] <= 255 );2221 assert( refCr[refOffset] >= 0 && refCr[refOffset] <= 255 );2222 2223 m_if.filterHorChroma( &refCb[refOffset], refStride, &dstCb[xTxt+j], dstStride, 1, nTxtPerDepthY, xFrac, !isBi );2224 m_if.filterHorChroma( &refCr[refOffset], refStride, &dstCr[xTxt+j], dstStride, 1, nTxtPerDepthY, xFrac, !isBi );2225 }2226 2227 #endif // NTT_VSP_DC_BUGFIX_E02082228 1884 } 2229 1885 refCb += refStrideBlock; … … 2233 1889 depth += depStrideBlock; 2234 1890 } 2235 2236 } 2237 #else // NTT_VSP_COMMON_E0207_E0208 2238 2239 // Input: 2240 // refPic: Ref picture. Full picture, with padding 2241 // posX, posY: PU position, texture 2242 // sizeX, sizeY: PU size 2243 // partAddr: z-order index 2244 // dv: disparity vector. derived from neighboring blocks 2245 // 2246 // Output: dstPic, PU predictor 64x64 2247 Void TComPrediction::xPredInterLumaBlkFromDM( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* dv, UInt partAddr,Int posX, Int posY 2248 , Int sizeX, Int sizeY, Bool isDepth, TComYuv *&dstPic, Bool bi ) 2249 { 2250 Int widthLuma; 2251 Int heightLuma; 2252 2253 if (isDepth) 2254 { 2255 widthLuma = pPicBaseDepth->getWidth(); 2256 heightLuma = pPicBaseDepth->getHeight(); 2257 } 2258 else 2259 { 2260 widthLuma = refPic->getWidth(); 2261 heightLuma = refPic->getHeight(); 2262 } 2263 2264 #if H_3D_VSP_BLOCKSIZE != 1 2265 Int widthDepth = pPicBaseDepth->getWidth(); 2266 Int heightDepth = pPicBaseDepth->getHeight(); 2267 #endif 2268 2269 #if H_3D_VSP_CONSTRAINED 2270 Int widthDepth = pPicBaseDepth->getWidth(); 2271 Int heightDepth = pPicBaseDepth->getHeight(); 2272 #endif 2273 2274 Int nTxtPerDepthX = widthLuma / ( pPicBaseDepth->getWidth() ); // texture pixel # per depth pixel 2275 Int nTxtPerDepthY = heightLuma / ( pPicBaseDepth->getHeight() ); 2276 2277 Int refStride = refPic->getStride(); 2278 Int dstStride = dstPic->getStride(); 2279 Int depStride = pPicBaseDepth->getStride(); 2280 Int depthPosX = Clip3(0, widthLuma - sizeX, (posX/nTxtPerDepthX) + ((dv->getHor()+2)>>2)); 2281 Int depthPosY = Clip3(0, heightLuma- sizeY, (posY/nTxtPerDepthY) + ((dv->getVer()+2)>>2)); 2282 Pel *ref = refPic->getLumaAddr() + posX + posY * refStride; 2283 Pel *dst = dstPic->getLumaAddr(partAddr); 2284 Pel *depth = pPicBaseDepth->getLumaAddr() + depthPosX + depthPosY * depStride; 2285 2286 #if H_3D_VSP_BLOCKSIZE != 1 2287 #if H_3D_VSP_BLOCKSIZE == 2 2288 Int dW = sizeX>>1; 2289 Int dH = sizeY>>1; 2290 #endif 2291 #if H_3D_VSP_BLOCKSIZE == 4 2292 Int dW = sizeX>>2; 2293 Int dH = sizeY>>2; 2294 #endif 2295 { 2296 Pel* depthi = depth; 2297 for (Int j = 0; j < dH; j++) 2298 { 2299 for (Int i = 0; i < dW; i++) 2300 { 2301 Pel* depthTmp; 2302 #if H_3D_VSP_BLOCKSIZE == 2 2303 if (depthPosX + (i<<1) < widthDepth) 2304 depthTmp = depthi + (i << 1); 2305 else 2306 depthTmp = depthi + (widthDepth - depthPosX - 1); 2307 #endif 2308 #if H_3D_VSP_BLOCKSIZE == 4 2309 if (depthPosX + (i<<2) < widthDepth) 2310 depthTmp = depthi + (i << 2); 2311 else 2312 depthTmp = depthi + (widthDepth - depthPosX - 1); 2313 #endif 2314 Int maxV = 0; 2315 for (Int blockj = 0; blockj < H_3D_VSP_BLOCKSIZE; blockj+=(H_3D_VSP_BLOCKSIZE-1)) 2316 { 2317 Int iX = 0; 2318 for (Int blocki = 0; blocki < H_3D_VSP_BLOCKSIZE; blocki+=(H_3D_VSP_BLOCKSIZE-1)) 2319 { 2320 if (maxV < depthTmp[iX]) 2321 maxV = depthTmp[iX]; 2322 #if H_3D_VSP_BLOCKSIZE == 2 2323 if (depthPosX + (i<<1) + blocki < widthDepth - 1) 2324 #else // H_3D_VSP_BLOCKSIZE == 4 2325 if (depthPosX + (i<<2) + blocki < widthDepth - 1) 2326 #endif 2327 iX = (H_3D_VSP_BLOCKSIZE-1); 2328 } 2329 #if H_3D_VSP_BLOCKSIZE == 2 2330 if (depthPosY + (j<<1) + blockj < heightDepth - 1) 2331 #else // H_3D_VSP_BLOCKSIZE == 4 2332 if (depthPosY + (j<<2) + blockj < heightDepth - 1) 2333 #endif 2334 depthTmp += depStride * (H_3D_VSP_BLOCKSIZE-1); 2335 } 2336 m_pDepthBlock[i+j*dW] = maxV; 2337 } // end of i < dW 2338 #if H_3D_VSP_BLOCKSIZE == 2 2339 if (depthPosY + ((j+1)<<1) < heightDepth) 2340 depthi += (depStride << 1); 2341 else 2342 depthi = depth + (heightDepth-depthPosY-1)*depStride; 2343 #endif 2344 #if H_3D_VSP_BLOCKSIZE == 4 2345 if (depthPosY + ((j+1)<<2) < heightDepth) // heightDepth-1 2346 depthi += (depStride << 2); 2347 else 2348 depthi = depth + (heightDepth-depthPosY-1)*depStride; // the last line 2349 #endif 2350 } 2351 } 2352 #endif // H_3D_VSP_BLOCKSIZE != 1 2353 2354 #if H_3D_VSP_BLOCKSIZE == 1 2355 #if H_3D_VSP_CONSTRAINED 2356 //get LUT based horizontal reference range 2357 Int range = xGetConstrainedSize(sizeX, sizeY); 2358 2359 // The minimum depth value 2360 Int minRelativePos = MAX_INT; 2361 Int maxRelativePos = MIN_INT; 2362 2363 Pel* depthTemp, *depthInitial=depth; 2364 for (Int yTxt = 0; yTxt < sizeY; yTxt++) 2365 { 2366 for (Int xTxt = 0; xTxt < sizeX; xTxt++) 2367 { 2368 if (depthPosX+xTxt < widthDepth) 2369 depthTemp = depthInitial + xTxt; 2370 else 2371 depthTemp = depthInitial + (widthDepth - depthPosX - 1); 2372 2373 Int disparity = pShiftLUT[ *depthTemp ]; // << iShiftPrec; 2374 Int disparityInt = disparity >> 2; 2375 2376 if( disparity <= 0) 2377 { 2378 if (minRelativePos > disparityInt+xTxt) 2379 minRelativePos = disparityInt+xTxt; 2380 } 2381 else 2382 { 2383 if (maxRelativePos < disparityInt+xTxt) 2384 maxRelativePos = disparityInt+xTxt; 2385 } 2386 } 2387 if (depthPosY+yTxt < heightDepth) 2388 depthInitial = depthInitial + depStride; 2389 } 2390 2391 Int disparity_tmp = pShiftLUT[ *depth ]; // << iShiftPrec; 2392 if (disparity_tmp <= 0) 2393 maxRelativePos = minRelativePos + range -1 ; 2394 else 2395 minRelativePos = maxRelativePos - range +1 ; 2396 #endif 2397 #endif // H_3D_VSP_BLOCKSIZE == 1 2398 2399 #if H_3D_VSP_BLOCKSIZE != 1 2400 Int yDepth = 0; 2401 #endif 2402 for ( Int yTxt = 0; yTxt < sizeY; yTxt += nTxtPerDepthY ) 2403 { 2404 for ( Int xTxt = 0, xDepth = 0; xTxt < sizeX; xTxt += nTxtPerDepthX, xDepth++ ) 2405 { 2406 Pel repDepth = 0; // to store the depth value used for warping 2407 #if H_3D_VSP_BLOCKSIZE == 1 2408 repDepth = depth[xDepth]; 2409 #endif 2410 #if H_3D_VSP_BLOCKSIZE == 2 2411 repDepth = m_pDepthBlock[(xTxt>>1) + (yTxt>>1)*dW]; 2412 #endif 2413 #if H_3D_VSP_BLOCKSIZE == 4 2414 repDepth = m_pDepthBlock[(xTxt>>2) + (yTxt>>2)*dW]; 2415 #endif 2416 2417 assert( repDepth >= 0 && repDepth <= 255 ); 2418 Int disparity = pShiftLUT[ repDepth ]; // remove << iShiftPrec ?? 2419 Int refOffset = xTxt + (disparity >> 2); 2420 Int xFrac = disparity & 0x3; 2421 #if H_3D_VSP_CONSTRAINED 2422 if(refOffset<minRelativePos || refOffset>maxRelativePos) 2423 xFrac = 0; 2424 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset); 2425 #endif 2426 Int absX = posX + refOffset; 2427 2428 if (xFrac == 0) 2429 absX = Clip3(0, widthLuma-1, absX); 2430 else 2431 absX = Clip3(4, widthLuma-5, absX); 2432 2433 refOffset = absX - posX; 2434 2435 assert( ref[refOffset] >= 0 && ref[refOffset]<= 255 ); 2436 m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !bi ); 2437 } 2438 ref += refStride*nTxtPerDepthY; 2439 dst += dstStride*nTxtPerDepthY; 2440 depth += depStride; 2441 #if H_3D_VSP_BLOCKSIZE != 1 2442 yDepth++; 2443 #endif 2444 2445 } 2446 } 2447 2448 Void TComPrediction::xPredInterChromaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv*dv, UInt partAddr, Int posX, Int posY 2449 , Int sizeX, Int sizeY, Bool isDepth, TComYuv *&dstPic, Bool bi) 2450 { 2451 Int refStride = refPic->getCStride(); 2452 Int dstStride = dstPic->getCStride(); 2453 Int depStride = pPicBaseDepth->getStride(); 2454 2455 Int widthChroma, heightChroma; 2456 if( isDepth) 2457 { 2458 widthChroma = pPicBaseDepth->getWidth()>>1; 2459 heightChroma = pPicBaseDepth->getHeight()>>1; 2460 } 2461 else 2462 { 2463 widthChroma = refPic->getWidth()>>1; 2464 heightChroma = refPic->getHeight()>>1; 2465 } 2466 2467 // Below is only for Texture chroma component 2468 2469 Int widthDepth = pPicBaseDepth->getWidth(); 2470 Int heightDepth = pPicBaseDepth->getHeight(); 2471 2472 Int nTxtPerDepthX, nTxtPerDepthY; // Number of texture samples per one depth sample 2473 Int nDepthPerTxtX, nDepthPerTxtY; // Number of depth samples per one texture sample 2474 2475 Int depthPosX; // Starting position in depth image 2476 Int depthPosY; 2477 2478 if ( widthChroma > widthDepth ) 2479 { 2480 nTxtPerDepthX = widthChroma / widthDepth; 2481 nDepthPerTxtX = 1; 2482 depthPosX = posX / nTxtPerDepthX + ((dv->getHor()+2)>>2); 2483 } 2484 else 2485 { 2486 nTxtPerDepthX = 1; 2487 nDepthPerTxtX = widthDepth / widthChroma; 2488 depthPosX = posX * nDepthPerTxtX + ((dv->getHor()+2)>>2); 2489 } 2490 depthPosX = Clip3(0, widthDepth - (sizeX<<1), depthPosX); 2491 if ( heightChroma > heightDepth ) 2492 { 2493 nTxtPerDepthY = heightChroma / heightDepth; 2494 nDepthPerTxtY = 1; 2495 depthPosY = posY / nTxtPerDepthY + ((dv->getVer()+2)>>2); 2496 } 2497 else 2498 { 2499 nTxtPerDepthY = 1; 2500 nDepthPerTxtY = heightDepth / heightChroma; 2501 depthPosY = posY * nDepthPerTxtY + ((dv->getVer()+2)>>2); 2502 } 2503 depthPosY = Clip3(0, heightDepth - (sizeY<<1), depthPosY); 2504 2505 Pel *refCb = refPic->getCbAddr() + posX + posY * refStride; 2506 Pel *refCr = refPic->getCrAddr() + posX + posY * refStride; 2507 Pel *dstCb = dstPic->getCbAddr(partAddr); 2508 Pel *dstCr = dstPic->getCrAddr(partAddr); 2509 Pel *depth = pPicBaseDepth->getLumaAddr() + depthPosX + depthPosY * depStride; // move the pointer to the current depth pixel position 2510 2511 Int refStrideBlock = refStride * nTxtPerDepthY; 2512 Int dstStrideBlock = dstStride * nTxtPerDepthY; 2513 Int depStrideBlock = depStride * nDepthPerTxtY; 2514 2515 if ( widthChroma > widthDepth ) // We assume 2516 { 2517 assert( heightChroma > heightDepth ); 2518 printf("This branch should never been reached.\n"); 2519 exit(0); 2520 } 2521 else 2522 { 2523 #if H_3D_VSP_BLOCKSIZE == 1 2524 Int dW = sizeX; 2525 Int dH = sizeY; 2526 Int sW = 2; // search window size 2527 Int sH = 2; 2528 #endif 2529 #if H_3D_VSP_BLOCKSIZE == 2 2530 Int dW = sizeX; 2531 Int dH = sizeY; 2532 Int sW = 2; // search window size 2533 Int sH = 2; 2534 #endif 2535 #if H_3D_VSP_BLOCKSIZE == 4 2536 Int dW = sizeX>>1; 2537 Int dH = sizeY>>1; 2538 Int sW = 4; // search window size 2539 Int sH = 4; 2540 #endif 2541 2542 { 2543 Pel* depthi = depth; 2544 for (Int j = 0; j < dH; j++) 2545 { 2546 for (Int i = 0; i < dW; i++) 2547 { 2548 Pel* depthTmp; 2549 #if H_3D_VSP_BLOCKSIZE == 1 2550 depthTmp = depthi + (i << 1); 2551 #endif 2552 #if H_3D_VSP_BLOCKSIZE == 2 2553 if (depthPosX + (i<<1) < widthDepth) 2554 depthTmp = depthi + (i << 1); 2555 else 2556 depthTmp = depthi + (widthDepth - depthPosX - 1); 2557 #endif 2558 #if H_3D_VSP_BLOCKSIZE == 4 2559 if (depthPosX + (i<<2) < widthDepth) 2560 depthTmp = depthi + (i << 2); 2561 else 2562 depthTmp = depthi + (widthDepth - depthPosX - 1); 2563 #endif 2564 Int maxV = 0; 2565 for (Int blockj = 0; blockj < sH; blockj+=(sH-1)) 2566 { 2567 Int iX = 0; 2568 for (Int blocki = 0; blocki < sW; blocki+=(sW-1)) 2569 { 2570 if (maxV < depthTmp[iX]) 2571 maxV = depthTmp[iX]; 2572 if (depthPosX + i*sW + blocki < widthDepth - 1) 2573 iX = (sW-1); 2574 } 2575 if (depthPosY + j*sH + blockj < heightDepth - 1) 2576 depthTmp += depStride * (sH-1); 2577 } 2578 m_pDepthBlock[i+j*dW] = maxV; 2579 } // end of i < dW 2580 #if H_3D_VSP_BLOCKSIZE == 1 2581 if (depthPosY + ((j+1)<<1) < heightDepth) 2582 depthi += (depStride << 1); 2583 else 2584 depthi = depth + (heightDepth-1)*depStride; 2585 #endif 2586 #if H_3D_VSP_BLOCKSIZE == 2 2587 if (depthPosY + ((j+1)<<1) < heightDepth) 2588 depthi += (depStride << 1); 2589 else 2590 depthi = depth + (heightDepth-depthPosY-1)*depStride; 2591 #endif 2592 #if H_3D_VSP_BLOCKSIZE == 4 2593 if (depthPosY + ((j+1)<<2) < heightDepth) // heightDepth-1 2594 depthi += (depStride << 2); 2595 else 2596 depthi = depth + (heightDepth-depthPosY-1)*depStride; // the last line 2597 #endif 2598 } 2599 } 2600 2601 2602 #if H_3D_VSP_BLOCKSIZE == 1 2603 #if H_3D_VSP_CONSTRAINED 2604 //get LUT based horizontal reference range 2605 Int range = xGetConstrainedSize(sizeX, sizeY, false); 2606 2607 // The minimum depth value 2608 Int minRelativePos = MAX_INT; 2609 Int maxRelativePos = MIN_INT; 2610 2611 Int depthTmp; 2612 for (Int yTxt=0; yTxt<sizeY; yTxt++) 2613 { 2614 for (Int xTxt=0; xTxt<sizeX; xTxt++) 2615 { 2616 depthTmp = m_pDepthBlock[xTxt+yTxt*dW]; 2617 Int disparity = pShiftLUT[ depthTmp ]; // << iShiftPrec; 2618 Int disparityInt = disparity >> 3;//in chroma resolution 2619 2620 if (disparityInt < 0) 2621 { 2622 if (minRelativePos > disparityInt+xTxt) 2623 minRelativePos = disparityInt+xTxt; 2624 } 2625 else 2626 { 2627 if (maxRelativePos < disparityInt+xTxt) 2628 maxRelativePos = disparityInt+xTxt; 2629 } 2630 } 2631 } 2632 2633 depthTmp = m_pDepthBlock[0]; 2634 Int disparity_tmp = pShiftLUT[ depthTmp ]; // << iShiftPrec; 2635 if ( disparity_tmp < 0 ) 2636 maxRelativePos = minRelativePos + range - 1; 2637 else 2638 minRelativePos = maxRelativePos - range + 1; 2639 2640 #endif // H_3D_VSP_CONSTRAINED 2641 #endif // H_3D_VSP_BLOCKSIZE == 1 2642 2643 // (sizeX, sizeY) is Chroma block size 2644 for ( Int yTxt = 0, yDepth = 0; yTxt < sizeY; yTxt += nTxtPerDepthY, yDepth += nDepthPerTxtY ) 2645 { 2646 for ( Int xTxt = 0, xDepth = 0; xTxt < sizeX; xTxt += nTxtPerDepthX, xDepth += nDepthPerTxtX ) 2647 { 2648 Pel repDepth = 0; // to store the depth value used for warping 2649 #if H_3D_VSP_BLOCKSIZE == 1 2650 repDepth = m_pDepthBlock[(xTxt) + (yTxt)*dW]; 2651 #endif 2652 #if H_3D_VSP_BLOCKSIZE == 2 2653 repDepth = m_pDepthBlock[(xTxt) + (yTxt)*dW]; 2654 #endif 2655 #if H_3D_VSP_BLOCKSIZE == 4 2656 repDepth = m_pDepthBlock[(xTxt>>1) + (yTxt>>1)*dW]; 2657 #endif 2658 2659 // calculate the offset in the reference picture 2660 Int disparity = pShiftLUT[ repDepth ]; // Remove << iShiftPrec; 2661 Int refOffset = xTxt + (disparity >> 3); // in integer pixel in chroma image 2662 Int xFrac = disparity & 0x7; 2663 #if H_3D_VSP_CONSTRAINED 2664 if(refOffset < minRelativePos || refOffset > maxRelativePos) 2665 xFrac = 0; 2666 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset); 2667 #endif 2668 Int absX = posX + refOffset; 2669 2670 if (xFrac == 0) 2671 absX = Clip3(0, widthChroma-1, absX); 2672 else 2673 absX = Clip3(4, widthChroma-5, absX); 2674 2675 refOffset = absX - posX; 2676 2677 assert( refCb[refOffset] >= 0 && refCb[refOffset]<= 255 ); 2678 assert( refCr[refOffset] >= 0 && refCr[refOffset]<= 255 ); 2679 m_if.filterHorChroma(&refCb[refOffset], refStride, &dstCb[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !bi); 2680 m_if.filterHorChroma(&refCr[refOffset], refStride, &dstCr[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !bi); 2681 } 2682 refCb += refStrideBlock; 2683 refCr += refStrideBlock; 2684 dstCb += dstStrideBlock; 2685 dstCr += dstStrideBlock; 2686 depth += depStrideBlock; 2687 } 2688 } 2689 2690 } 2691 2692 #endif // NTT_VSP_COMMON_E0207_E0208 1891 } 1892 2693 1893 2694 1894 #if H_3D_VSP_CONSTRAINED … … 2768 1968 2769 1969 #if H_3D_DIM_DMM 2770 #if !SEC_DMM2_E0146_HHIFIX2771 UInt TComPrediction::xPredWedgeFromIntra( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Int iDeltaEnd )2772 {2773 UInt uiThisBlockSize = uiWidth;2774 2775 TComDataCU* pcTempCU;2776 UInt uiTempPartIdx;2777 // 1st: try continue above wedgelet2778 pcTempCU = pcCU->getPUAbove( uiTempPartIdx, pcCU->getZorderIdxInCU() + uiAbsPartIdx );2779 if( pcTempCU && isDimMode( pcTempCU->getLumaIntraDir( uiTempPartIdx ) ) )2780 {2781 UInt dimType = getDimType( pcTempCU->getLumaIntraDir( uiTempPartIdx ) );2782 if( DMM1_IDX == dimType || DMM2_IDX == dimType || DMM3_IDX == dimType )2783 {2784 // get offset between current and reference block2785 UInt uiOffsetX = 0, uiOffsetY = 0;2786 xGetBlockOffset( pcCU, uiAbsPartIdx, pcTempCU, uiTempPartIdx, uiOffsetX, uiOffsetY );2787 2788 // get reference wedgelet2789 WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[(pcTempCU->getWidth( uiTempPartIdx )>>((pcTempCU->getPartitionSize( uiTempPartIdx ) == SIZE_NxN) ? 1 : 0))])];2790 TComWedgelet* pcRefWedgelet = &(pacWedgeList->at( pcTempCU->getDmmWedgeTabIdx( dimType, uiTempPartIdx ) ) );2791 2792 // find wedgelet, if direction is suitable for continue wedge2793 if( pcRefWedgelet->checkPredDirAbovePossible( uiThisBlockSize, uiOffsetX ) )2794 {2795 UChar uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye;2796 pcRefWedgelet->getPredDirStartEndAbove( uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye, uiThisBlockSize, uiOffsetX, iDeltaEnd );2797 return xGetWedgePatternIdx( uiThisBlockSize, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye );2798 }2799 }2800 }2801 2802 // 2nd: try continue left wedglelet2803 pcTempCU = pcCU->getPULeft( uiTempPartIdx, pcCU->getZorderIdxInCU() + uiAbsPartIdx );2804 if( pcTempCU && isDimMode( pcTempCU->getLumaIntraDir( uiTempPartIdx ) ) )2805 {2806 UInt dimType = getDimType( pcTempCU->getLumaIntraDir( uiTempPartIdx ) );2807 if( DMM1_IDX == dimType || DMM2_IDX == dimType || DMM3_IDX == dimType )2808 {2809 // get offset between current and reference block2810 UInt uiOffsetX = 0, uiOffsetY = 0;2811 xGetBlockOffset( pcCU, uiAbsPartIdx, pcTempCU, uiTempPartIdx, uiOffsetX, uiOffsetY );2812 2813 // get reference wedgelet2814 WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[(pcTempCU->getWidth( uiTempPartIdx )>>((pcTempCU->getPartitionSize( uiTempPartIdx ) == SIZE_NxN) ? 1 : 0))])];2815 TComWedgelet* pcRefWedgelet = &(pacWedgeList->at( pcTempCU->getDmmWedgeTabIdx( dimType, uiTempPartIdx ) ) );2816 2817 // find wedgelet, if direction is suitable for continue wedge2818 if( pcRefWedgelet->checkPredDirLeftPossible( uiThisBlockSize, uiOffsetY ) )2819 {2820 UChar uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye;2821 pcRefWedgelet->getPredDirStartEndLeft( uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye, uiThisBlockSize, uiOffsetY, iDeltaEnd );2822 return xGetWedgePatternIdx( uiThisBlockSize, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye );2823 }2824 }2825 }2826 2827 // 3rd: (default) make wedglet from intra dir and max slope point2828 Int iSlopeX = 0, iSlopeY = 0;2829 UInt uiStartPosX = 0, uiStartPosY = 0;2830 if( xGetWedgeIntraDirPredData( pcCU, uiAbsPartIdx, uiThisBlockSize, iSlopeX, iSlopeY, uiStartPosX, uiStartPosY ) )2831 {2832 UChar uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye;2833 xGetWedgeIntraDirStartEnd( pcCU, uiAbsPartIdx, uiThisBlockSize, iSlopeX, iSlopeY, uiStartPosX, uiStartPosY, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye, iDeltaEnd );2834 return xGetWedgePatternIdx( uiThisBlockSize, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye );2835 }2836 2837 return 0;2838 }2839 #endif2840 2841 1970 UInt TComPrediction::xPredWedgeFromTex( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt intraTabIdx ) 2842 1971 { … … 2847 1976 Int uiColTexIntraDir = pcColTexCU->isIntra( uiTexPartIdx ) ? pcColTexCU->getLumaIntraDir( uiTexPartIdx ) : 255; 2848 1977 2849 #if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX2850 1978 assert( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 ); 2851 1979 return g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]][uiColTexIntraDir-2].at(intraTabIdx); 2852 #else2853 if( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 ) { return g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]][uiColTexIntraDir-2].at(intraTabIdx); }2854 else { return g_dmmWedgeNodeLists[(g_aucConvertToBit[uiWidth])].at(intraTabIdx).getPatternIdx(); }2855 #endif2856 1980 } 2857 1981 … … 2875 1999 } 2876 2000 2877 #if SCU_HS_DMM4_REMOVE_DIV_E0242 2878 Int cuMaxLog2Size = g_aucConvertToBit[g_uiMaxCUWidth]+2; 2879 iDC = iDC >> (cuMaxLog2Size - pcCU->getDepth(0))*2; 2880 #else 2881 iDC /= (uiWidth*uiHeight); 2882 #endif 2001 Int cuMaxLog2Size = g_aucConvertToBit[g_uiMaxCUWidth]+2; // 2002 iDC = iDC >> (cuMaxLog2Size - pcCU->getDepth(0))*2; // iDC /= (uiWidth*uiHeight); 2003 2883 2004 piRefBlkY = cTempYuv.getLumaAddr(); 2884 2005 … … 2907 2028 } 2908 2029 } 2909 2910 #if !SEC_DMM2_E0146_HHIFIX 2911 Void TComPrediction::xGetBlockOffset( TComDataCU* pcCU, UInt uiAbsPartIdx, TComDataCU* pcRefCU, UInt uiRefAbsPartIdx, UInt& ruiOffsetX, UInt& ruiOffsetY ) 2912 { 2913 ruiOffsetX = 0; 2914 ruiOffsetY = 0; 2915 2916 // get offset between current and above/left block 2917 UInt uiThisOriginX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; 2918 UInt uiThisOriginY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; 2919 2920 UInt uiNumPartInRefCU = pcRefCU->getTotalNumPart(); 2921 UInt uiMaxDepthRefCU = 0; 2922 while( uiNumPartInRefCU > 1 ) 2923 { 2924 uiNumPartInRefCU >>= 2; 2925 uiMaxDepthRefCU++; 2926 } 2927 2928 UInt uiDepthRefPU = (pcRefCU->getDepth(uiRefAbsPartIdx)) + (pcRefCU->getPartitionSize(uiRefAbsPartIdx) == SIZE_2Nx2N ? 0 : 1); 2929 UInt uiShifts = (uiMaxDepthRefCU - uiDepthRefPU)*2; 2930 UInt uiRefBlockOriginPartIdx = (uiRefAbsPartIdx>>uiShifts)<<uiShifts; 2931 2932 UInt uiRefOriginX = pcRefCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiRefBlockOriginPartIdx] ]; 2933 UInt uiRefOriginY = pcRefCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiRefBlockOriginPartIdx] ]; 2934 2935 if( (uiThisOriginX - uiRefOriginX) > 0 ) { ruiOffsetX = (UInt)(uiThisOriginX - uiRefOriginX); } 2936 if( (uiThisOriginY - uiRefOriginY) > 0 ) { ruiOffsetY = (UInt)(uiThisOriginY - uiRefOriginY); } 2937 } 2938 2939 Bool TComPrediction::xGetWedgeIntraDirPredData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiBlockSize, Int& riSlopeX, Int& riSlopeY, UInt& ruiStartPosX, UInt& ruiStartPosY ) 2940 { 2941 riSlopeX = 0, riSlopeY = 0, ruiStartPosX = 0, ruiStartPosY = 0; 2942 2943 // 1st step: get wedge start point (max. slope) 2944 Int* piSource = pcCU->getPattern()->getAdiOrgBuf( uiBlockSize, uiBlockSize, m_piYuvExt ); 2945 Int iSourceStride = ( uiBlockSize<<1 ) + 1; 2946 2947 UInt uiSlopeMaxAbove = 0, uiPosSlopeMaxAbove = 0; 2948 for( UInt uiPosHor = 0; uiPosHor < (uiBlockSize-1); uiPosHor++ ) 2949 { 2950 if( abs( piSource[uiPosHor+1] - piSource[uiPosHor] ) > uiSlopeMaxAbove ) 2951 { 2952 uiSlopeMaxAbove = abs( piSource[uiPosHor+1] - piSource[uiPosHor] ); 2953 uiPosSlopeMaxAbove = uiPosHor; 2954 } 2955 } 2956 2957 UInt uiSlopeMaxLeft = 0, uiPosSlopeMaxLeft = 0; 2958 for( UInt uiPosVer = 0; uiPosVer < (uiBlockSize-1); uiPosVer++ ) 2959 { 2960 if( abs( piSource[(uiPosVer+1)*iSourceStride] - piSource[uiPosVer*iSourceStride] ) > uiSlopeMaxLeft ) 2961 { 2962 uiSlopeMaxLeft = abs( piSource[(uiPosVer+1)*iSourceStride] - piSource[uiPosVer*iSourceStride] ); 2963 uiPosSlopeMaxLeft = uiPosVer; 2964 } 2965 } 2966 2967 if( uiSlopeMaxAbove == 0 && uiSlopeMaxLeft == 0 ) 2968 { 2969 return false; 2970 } 2971 2972 ruiStartPosX = ( uiSlopeMaxAbove > uiSlopeMaxLeft ) ? uiPosSlopeMaxAbove : 0; 2973 ruiStartPosY = ( uiSlopeMaxLeft >= uiSlopeMaxAbove ) ? uiPosSlopeMaxLeft : 0; 2974 2975 // 2nd step: derive wedge direction 2976 Int uiPreds[3] = {-1, -1, -1}; 2977 Int iMode = -1; 2978 Int iPredNum = pcCU->getIntraDirLumaPredictor( uiAbsPartIdx, uiPreds, &iMode ); 2979 2980 UInt uiDirMode = 0; 2981 if( iMode >= 0 ) { iPredNum = iMode; } 2982 if( iPredNum == 1 ) { uiDirMode = uiPreds[0]; } 2983 if( iPredNum == 2 ) { uiDirMode = uiPreds[1]; } 2984 2985 if( uiDirMode < 2 ) { return false; } // no planar & DC 2986 2987 Bool modeHor = (uiDirMode < 18); 2988 Bool modeVer = !modeHor; 2989 Int intraPredAngle = modeVer ? (Int)uiDirMode - VER_IDX : modeHor ? -((Int)uiDirMode - HOR_IDX) : 0; 2990 Int absAng = abs(intraPredAngle); 2991 Int signAng = intraPredAngle < 0 ? -1 : 1; 2992 Int angTable[9] = {0,2,5,9,13,17,21,26,32}; 2993 absAng = angTable[absAng]; 2994 intraPredAngle = signAng * absAng; 2995 2996 // 3rd step: set slope for direction 2997 if( modeHor ) 2998 { 2999 riSlopeX = ( intraPredAngle > 0 ) ? -32 : 32; 3000 riSlopeY = ( intraPredAngle > 0 ) ? intraPredAngle : -intraPredAngle; 3001 } 3002 else if( modeVer ) 3003 { 3004 riSlopeX = ( intraPredAngle > 0 ) ? intraPredAngle : -intraPredAngle; 3005 riSlopeY = ( intraPredAngle > 0 ) ? -32 : 32; 3006 } 3007 3008 return true; 3009 } 3010 3011 Void TComPrediction::xGetWedgeIntraDirStartEnd( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiBlockSize, Int iDeltaX, Int iDeltaY, UInt uiPMSPosX, UInt uiPMSPosY, UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, Int iDeltaEnd ) 3012 { 3013 ruhXs = 0; 3014 ruhYs = 0; 3015 ruhXe = 0; 3016 ruhYe = 0; 3017 3018 // scaling of start pos and block size to wedge resolution 3019 UInt uiScaledStartPosX = 0; 3020 UInt uiScaledStartPosY = 0; 3021 UInt uiScaledBlockSize = 0; 3022 WedgeResolution eWedgeRes = g_dmmWedgeResolution[(UInt)g_aucConvertToBit[uiBlockSize]]; 3023 switch( eWedgeRes ) 3024 { 3025 case( DOUBLE_PEL ): { uiScaledStartPosX = (uiPMSPosX>>1); uiScaledStartPosY = (uiPMSPosY>>1); uiScaledBlockSize = (uiBlockSize>>1); break; } 3026 case( FULL_PEL ): { uiScaledStartPosX = uiPMSPosX; uiScaledStartPosY = uiPMSPosY; uiScaledBlockSize = uiBlockSize; break; } 3027 case( HALF_PEL ): { uiScaledStartPosX = (uiPMSPosX<<1); uiScaledStartPosY = (uiPMSPosY<<1); uiScaledBlockSize = (uiBlockSize<<1); break; } 3028 } 3029 Int iMaxPos = (Int)uiScaledBlockSize - 1; 3030 3031 // case above 3032 if( uiScaledStartPosX > 0 && uiScaledStartPosY == 0 ) 3033 { 3034 ruhXs = (UChar)uiScaledStartPosX; 3035 ruhYs = 0; 3036 3037 if( iDeltaY == 0 ) 3038 { 3039 if( iDeltaX < 0 ) 3040 { 3041 ruhXe = 0; 3042 ruhYe = (UChar)std::min( std::max( iDeltaEnd, 0 ), iMaxPos ); 3043 return; 3044 } 3045 else 3046 { 3047 ruhXe = (UChar)iMaxPos; 3048 ruhYe = (UChar)std::min( std::max( -iDeltaEnd, 0 ), iMaxPos ); 3049 std::swap( ruhXs, ruhXe ); 3050 std::swap( ruhYs, ruhYe ); 3051 return; 3052 } 3053 } 3054 3055 // regular case 3056 Int iVirtualEndX = (Int)ruhXs + roftoi( (Double)iMaxPos * ((Double)iDeltaX / (Double)iDeltaY) ); 3057 3058 if( iVirtualEndX < 0 ) 3059 { 3060 Int iYe = roftoi( (Double)(0 - (Int)ruhXs) * ((Double)iDeltaY / (Double)iDeltaX) ) + iDeltaEnd; 3061 if( iYe < (Int)uiScaledBlockSize ) 3062 { 3063 ruhXe = 0; 3064 ruhYe = (UChar)std::max( iYe, 0 ); 3065 return; 3066 } 3067 else 3068 { 3069 ruhXe = (UChar)std::min( (iYe - iMaxPos), iMaxPos ); 3070 ruhYe = (UChar)iMaxPos; 3071 return; 3072 } 3073 } 3074 else if( iVirtualEndX > iMaxPos ) 3075 { 3076 Int iYe = roftoi( (Double)(iMaxPos - (Int)ruhXs) * ((Double)iDeltaY / (Double)iDeltaX) ) - iDeltaEnd; 3077 if( iYe < (Int)uiScaledBlockSize ) 3078 { 3079 ruhXe = (UChar)iMaxPos; 3080 ruhYe = (UChar)std::max( iYe, 0 ); 3081 std::swap( ruhXs, ruhXe ); 3082 std::swap( ruhYs, ruhYe ); 3083 return; 3084 } 3085 else 3086 { 3087 ruhXe = (UChar)std::max( (iMaxPos - (iYe - iMaxPos)), 0 ); 3088 ruhYe = (UChar)iMaxPos; 3089 return; 3090 } 3091 } 3092 else 3093 { 3094 Int iXe = iVirtualEndX + iDeltaEnd; 3095 if( iXe < 0 ) 3096 { 3097 ruhXe = 0; 3098 ruhYe = (UChar)std::max( (iMaxPos + iXe), 0 ); 3099 return; 3100 } 3101 else if( iXe > iMaxPos ) 3102 { 3103 ruhXe = (UChar)iMaxPos; 3104 ruhYe = (UChar)std::max( (iMaxPos - (iXe - iMaxPos)), 0 ); 3105 std::swap( ruhXs, ruhXe ); 3106 std::swap( ruhYs, ruhYe ); 3107 return; 3108 } 3109 else 3110 { 3111 ruhXe = (UChar)iXe; 3112 ruhYe = (UChar)iMaxPos; 3113 return; 3114 } 3115 } 3116 } 3117 3118 // case left 3119 if( uiScaledStartPosY > 0 && uiScaledStartPosX == 0 ) 3120 { 3121 ruhXs = 0; 3122 ruhYs = (UChar)uiScaledStartPosY; 3123 3124 if( iDeltaX == 0 ) 3125 { 3126 if( iDeltaY < 0 ) 3127 { 3128 ruhXe = (UChar)std::min( std::max( -iDeltaEnd, 0 ), iMaxPos ); 3129 ruhYe = 0; 3130 std::swap( ruhXs, ruhXe ); 3131 std::swap( ruhYs, ruhYe ); 3132 return; 3133 } 3134 else 3135 { 3136 ruhXe = (UChar)std::min( std::max( iDeltaEnd, 0 ), iMaxPos ); 3137 ruhYe = (UChar)iMaxPos; 3138 return; 3139 } 3140 } 3141 3142 // regular case 3143 Int iVirtualEndY = (Int)ruhYs + roftoi( (Double)iMaxPos * ((Double)iDeltaY / (Double)iDeltaX) ); 3144 3145 if( iVirtualEndY < 0 ) 3146 { 3147 Int iXe = roftoi( (Double)(0 - (Int)ruhYs ) * ((Double)iDeltaX / (Double)iDeltaY) ) - iDeltaEnd; 3148 if( iXe < (Int)uiScaledBlockSize ) 3149 { 3150 ruhXe = (UChar)std::max( iXe, 0 ); 3151 ruhYe = 0; 3152 std::swap( ruhXs, ruhXe ); 3153 std::swap( ruhYs, ruhYe ); 3154 return; 3155 } 3156 else 3157 { 3158 ruhXe = (UChar)iMaxPos; 3159 ruhYe = (UChar)std::min( (iXe - iMaxPos), iMaxPos ); 3160 std::swap( ruhXs, ruhXe ); 3161 std::swap( ruhYs, ruhYe ); 3162 return; 3163 } 3164 } 3165 else if( iVirtualEndY > (uiScaledBlockSize-1) ) 3166 { 3167 Int iXe = roftoi( (Double)((Int)(uiScaledBlockSize-1) - (Int)ruhYs ) * ((Double)iDeltaX / (Double)iDeltaY) ) + iDeltaEnd; 3168 if( iXe < (Int)uiScaledBlockSize ) 3169 { 3170 ruhXe = (UChar)std::max( iXe, 0 ); 3171 ruhYe = (UChar)(uiScaledBlockSize-1); 3172 return; 3173 } 3174 else 3175 { 3176 ruhXe = (UChar)iMaxPos; 3177 ruhYe = (UChar)std::max( (iMaxPos - (iXe - iMaxPos)), 0 ); 3178 std::swap( ruhXs, ruhXe ); 3179 std::swap( ruhYs, ruhYe ); 3180 return; 3181 } 3182 } 3183 else 3184 { 3185 Int iYe = iVirtualEndY - iDeltaEnd; 3186 if( iYe < 0 ) 3187 { 3188 ruhXe = (UChar)std::max( (iMaxPos + iYe), 0 ); 3189 ruhYe = 0; 3190 std::swap( ruhXs, ruhXe ); 3191 std::swap( ruhYs, ruhYe ); 3192 return; 3193 } 3194 else if( iYe > iMaxPos ) 3195 { 3196 ruhXe = (UChar)std::max( (iMaxPos - (iYe - iMaxPos)), 0 ); 3197 ruhYe = (UChar)iMaxPos; 3198 return; 3199 } 3200 else 3201 { 3202 ruhXe = (UChar)iMaxPos; 3203 ruhYe = (UChar)iYe; 3204 std::swap( ruhXs, ruhXe ); 3205 std::swap( ruhYs, ruhYe ); 3206 return; 3207 } 3208 } 3209 } 3210 3211 // case origin 3212 if( uiScaledStartPosX == 0 && uiScaledStartPosY == 0 ) 3213 { 3214 if( iDeltaX*iDeltaY < 0 ) 3215 { 3216 return; 3217 } 3218 3219 ruhXs = 0; 3220 ruhYs = 0; 3221 3222 if( iDeltaY == 0 ) 3223 { 3224 ruhXe = (UChar)iMaxPos; 3225 ruhYe = 0; 3226 std::swap( ruhXs, ruhXe ); 3227 std::swap( ruhYs, ruhYe ); 3228 return; 3229 } 3230 3231 if( iDeltaX == 0 ) 3232 { 3233 ruhXe = 0; 3234 ruhYe = (UChar)iMaxPos; 3235 return; 3236 } 3237 3238 Int iVirtualEndX = (Int)ruhXs + roftoi( (Double)iMaxPos * ((Double)iDeltaX / (Double)iDeltaY) ); 3239 3240 if( iVirtualEndX > iMaxPos ) 3241 { 3242 Int iYe = roftoi( (Double)((Int)iMaxPos - (Int)ruhXs) * ((Double)iDeltaY / (Double)iDeltaX) ) - iDeltaEnd; 3243 if( iYe < (Int)uiScaledBlockSize ) 3244 { 3245 ruhXe = (UChar)(uiScaledBlockSize-1); 3246 ruhYe = (UChar)std::max( iYe, 0 ); 3247 std::swap( ruhXs, ruhXe ); 3248 std::swap( ruhYs, ruhYe ); 3249 return; 3250 } 3251 else 3252 { 3253 ruhXe = (UChar)std::max( (iMaxPos - (iYe - iMaxPos)), 0 ); 3254 ruhYe = (UChar)(uiScaledBlockSize-1); 3255 return; 3256 } 3257 } 3258 else 3259 { 3260 Int iXe = iVirtualEndX + iDeltaEnd; 3261 if( iXe < 0 ) 3262 { 3263 ruhXe = 0; 3264 ruhYe = (UChar)std::max( (iMaxPos + iXe), 0 ); 3265 return; 3266 } 3267 else if( iXe > iMaxPos ) 3268 { 3269 ruhXe = (UChar)(uiScaledBlockSize-1); 3270 ruhYe = (UChar)std::max( (iMaxPos - (iXe - iMaxPos)), 0 ); 3271 std::swap( ruhXs, ruhXe ); 3272 std::swap( ruhYs, ruhYe ); 3273 return; 3274 } 3275 else 3276 { 3277 ruhXe = (UChar)iXe; 3278 ruhYe = (UChar)(uiScaledBlockSize-1); 3279 return; 3280 } 3281 } 3282 } 3283 } 3284 3285 UInt TComPrediction::xGetWedgePatternIdx( UInt uiBlockSize, UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe ) 3286 { 3287 WedgeRefList* pcWedgeRefList = &g_dmmWedgeRefLists[(g_aucConvertToBit[uiBlockSize])]; 3288 for( UInt uiIdx = 0; uiIdx < pcWedgeRefList->size(); uiIdx++ ) 3289 { 3290 TComWedgeRef* pcTestWedgeRef = &(pcWedgeRefList->at(uiIdx)); 3291 if( pcTestWedgeRef->getStartX() == uhXs && pcTestWedgeRef->getStartY() == uhYs && pcTestWedgeRef->getEndX() == uhXe && pcTestWedgeRef->getEndY() == uhYe ) 3292 { 3293 return pcTestWedgeRef->getRefIdx(); 3294 } 3295 } 3296 return 0; 3297 } 3298 #endif 3299 #endif 2030 #endif 2031 3300 2032 #if H_3D_DIM_RBC 3301 2033 Void TComPrediction::xDeltaDCQuantScaleUp( TComDataCU* pcCU, Pel& rDeltaDC ) … … 3327 2059 #if H_3D_DIM_SDC 3328 2060 Void TComPrediction::analyzeSegmentsSDC( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride 3329 #if KWU_SDC_SIMPLE_DC_E01173330 2061 ,UInt uiIntraMode 3331 2062 ,Bool orgDC 3332 #endif3333 2063 ) 3334 2064 { … … 3338 2068 memset(iSumPix, 0, sizeof(Int)*2); 3339 2069 3340 #if KWU_SDC_SIMPLE_DC_E01173341 2070 if (orgDC == false) 3342 2071 { … … 3364 2093 return; 3365 2094 } 3366 #endif3367 2095 3368 2096 Int subSamplePix; -
TabularUnified trunk/source/Lib/TLibCommon/TComPrediction.h ¶
r622 r655 76 76 Int m_iLumaRecStride; ///< stride of #m_pLumaRecBuffer array 77 77 #if H_3D_IC 78 #if SHARP_ILLUCOMP_REFINE_E004679 78 UInt m_uiaShift[ 64 ]; // Table for multiplication to substitue of division operation 80 #else81 UInt m_uiaShift[ 63 ]; // Table for multiplication to substitue of division operation82 #endif83 79 #endif 84 80 … … 88 84 Int xGetConstrainedSize(Int nPbW, Int nPbH, Bool bLuma = true); 89 85 #endif 90 #if NTT_VSP_COMMON_E0207_E020891 86 TComYuv m_cYuvDepthOnVsp; 92 #endif93 87 #endif 94 88 … … 126 120 127 121 #if H_3D_VSP 128 #if NTT_VSP_COMMON_E0207_E0208129 122 Void xGetVirtualDepth ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int txtPerDepthX=1, Int txtPerDepthY=1 ); 130 123 Void xPredInterLumaBlkFromDM ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi ); 131 124 Void xPredInterChromaBlkFromDM ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi ); 132 #else133 Void xPredInterLumaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* dv, UInt partAddr, Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth, TComYuv *&dstPic, Bool bi );134 Void xPredInterChromaBlkFromDM( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* dv, UInt partAddr, Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth, TComYuv *&dstPic, Bool bi );135 #endif136 125 #endif 137 126 … … 140 129 Void xGetLLSPrediction ( TComPattern* pcPattern, Int* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0 ); 141 130 #if H_3D_IC 142 #if SHARP_ILLUCOMP_REFINE_E0046143 131 Void xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, TextType eType ); 144 #else145 Void xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift, TextType eType );146 #endif147 132 #endif 148 133 Void xDCPredFiltering( Int* pSrc, Int iSrcStride, Pel*& rpDst, Int iDstStride, Int iWidth, Int iHeight ); … … 154 139 Void xAssignBiSegDCs ( Pel* ptrDst, UInt dstStride, Bool* biSegPattern, Int patternStride, Pel valDC1, Pel valDC2 ); 155 140 #if H_3D_DIM_DMM 156 #if !SEC_DMM2_E0146_HHIFIX157 UInt xPredWedgeFromIntra ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Int iDeltaEnd = 0 );158 #endif159 141 UInt xPredWedgeFromTex ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt intraTabIdx ); 160 142 Void xPredContourFromTex ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, TComWedgelet* pcContourWedge ); 161 162 143 Void xCopyTextureLumaBlock ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piDestBlockY, UInt uiWidth, UInt uiHeight ); 163 164 #if !SEC_DMM2_E0146_HHIFIX165 Void xGetBlockOffset ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComDataCU* pcRefCU, UInt uiRefAbsPartIdx, UInt& ruiOffsetX, UInt& ruiOffsetY );166 Bool xGetWedgeIntraDirPredData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiBlockSize, Int& riSlopeX, Int& riSlopeY, UInt& ruiStartPosX, UInt& ruiStartPosY );167 Void xGetWedgeIntraDirStartEnd( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiBlockSize, Int iDeltaX, Int iDeltaY, UInt uiPMSPosX, UInt uiPMSPosY, UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, Int iDeltaEnd = 0 );168 UInt xGetWedgePatternIdx ( UInt uiBlockSize, UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe );169 #endif170 144 #endif 171 145 #if H_3D_DIM_RBC … … 196 170 #if H_3D_DIM_SDC 197 171 Void analyzeSegmentsSDC ( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride 198 #if KWU_SDC_SIMPLE_DC_E0117199 172 ,UInt uiIntraMode 200 173 ,Bool orgDC=false 201 #endif202 174 ); 203 175 #endif -
TabularUnified trunk/source/Lib/TLibCommon/TComRdCost.cpp ¶
r622 r655 484 484 } 485 485 486 #if SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX486 #if H_3D_FAST_DEPTH_INTRA 487 487 488 488 UInt TComRdCost::calcVAR (Pel* pi0, Int stride, Int width, Int height, Int cuDepth) … … 542 542 cDtParam.bUseIC = false; 543 543 #endif 544 #if LGE_INTER_SDC_E0156544 #if H_3D_INTER_SDC 545 545 cDtParam.bUseSDCMRSAD = false; 546 546 #endif … … 605 605 dist = (Dist) (iDWeight * distDepth + iVSOWeight * dist ) / ( iDWeight + iVSOWeight); 606 606 } 607 #if H_3D_FIX_UINT_WARNING 607 608 608 return (UInt) dist; 609 #else 610 return dist; 611 #endif 612 613 } 614 #endif 615 616 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 609 } 610 #endif 611 612 #if (RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT) || KWU_RC_MADPRED_E0227 617 613 UInt TComRdCost::getSADPart ( Int bitDepth, Pel* pelCur, Int curStride, Pel* pelOrg, Int orgStride, UInt width, UInt height ) 618 614 { … … 652 648 } 653 649 #endif 654 #if LGE_INTER_SDC_E0156650 #if H_3D_INTER_SDC 655 651 if( pcDtParam->bUseSDCMRSAD ) 656 652 { … … 692 688 } 693 689 #endif 694 #if LGE_INTER_SDC_E0156690 #if H_3D_INTER_SDC 695 691 if( pcDtParam->bUseSDCMRSAD ) 696 692 { … … 735 731 } 736 732 #endif 737 #if LGE_INTER_SDC_E0156733 #if H_3D_INTER_SDC 738 734 if( pcDtParam->bUseSDCMRSAD ) 739 735 { … … 782 778 } 783 779 #endif 784 #if LGE_INTER_SDC_E0156780 #if H_3D_INTER_SDC 785 781 if( pcDtParam->bUseSDCMRSAD ) 786 782 { … … 838 834 } 839 835 #endif 840 #if LGE_INTER_SDC_E0156836 #if H_3D_INTER_SDC 841 837 if( pcDtParam->bUseSDCMRSAD ) 842 838 { … … 886 882 } 887 883 #endif 888 #if LGE_INTER_SDC_E0156884 #if H_3D_INTER_SDC 889 885 if( pcDtParam->bUseSDCMRSAD ) 890 886 { … … 944 940 } 945 941 #endif 946 #if LGE_INTER_SDC_E0156942 #if H_3D_INTER_SDC 947 943 if( pcDtParam->bUseSDCMRSAD ) 948 944 { … … 1016 1012 } 1017 1013 #endif 1018 #if LGE_INTER_SDC_E01561014 #if H_3D_INTER_SDC 1019 1015 if( pcDtParam->bUseSDCMRSAD ) 1020 1016 { … … 1081 1077 } 1082 1078 #endif 1083 #if LGE_INTER_SDC_E01561079 #if H_3D_INTER_SDC 1084 1080 if( pcDtParam->bUseSDCMRSAD ) 1085 1081 { … … 1185 1181 } 1186 1182 #endif 1187 #if LGE_INTER_SDC_E01561183 #if H_3D_INTER_SDC 1188 1184 if( pcDtParam->bUseSDCMRSAD ) 1189 1185 { … … 1261 1257 #endif 1262 1258 1263 #if H_3D_IC || LGE_INTER_SDC_E01561259 #if H_3D_IC || H_3D_INTER_SDC 1264 1260 UInt TComRdCost::xGetSADic( DistParam* pcDtParam ) 1265 1261 { … … 3513 3509 } 3514 3510 #endif 3515 #if LGE_INTER_SDC_E01563511 #if H_3D_INTER_SDC 3516 3512 if( pcDtParam->bUseSDCMRSAD ) 3517 3513 { … … 3616 3612 } 3617 3613 3618 #if H_3D_IC || LGE_INTER_SDC_E01563614 #if H_3D_IC || H_3D_INTER_SDC 3619 3615 UInt TComRdCost::xGetHADsic( DistParam* pcDtParam ) 3620 3616 { -
TabularUnified trunk/source/Lib/TLibCommon/TComRdCost.h ¶
r622 r655 94 94 Bool bUseIC; 95 95 #endif 96 #if LGE_INTER_SDC_E015696 #if H_3D_INTER_SDC 97 97 Bool bUseSDCMRSAD; 98 98 #endif … … 136 136 iStrideVir = 0; 137 137 #endif 138 #if LGE_INTER_SDC_E0156138 #if H_3D_INTER_SDC 139 139 bUseSDCMRSAD = false; 140 140 #endif … … 148 148 private: 149 149 // for distortion 150 Int m_iBlkWidth;151 Int m_iBlkHeight;152 150 153 151 #if AMP_SAD … … 235 233 UInt calcHAD(Int bitDepth, Pel* pi0, Int iStride0, Pel* pi1, Int iStride1, Int iWidth, Int iHeight ); 236 234 237 #if SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX235 #if H_3D_FAST_DEPTH_INTRA 238 236 UInt calcVAR(Pel* pi0, Int stride, Int width, Int height, Int cuDepth); 239 237 #endif … … 283 281 static UInt xGetSSE64 ( DistParam* pcDtParam ); 284 282 static UInt xGetSSE16N ( DistParam* pcDtParam ); 285 #if H_3D_IC || LGE_INTER_SDC_E0156283 #if H_3D_IC || H_3D_INTER_SDC 286 284 static UInt xGetSADic ( DistParam* pcDtParam ); 287 285 static UInt xGetSAD4ic ( DistParam* pcDtParam ); … … 311 309 312 310 #if AMP_SAD 313 #if H_3D_IC || LGE_INTER_SDC_E0156311 #if H_3D_IC || H_3D_INTER_SDC 314 312 static UInt xGetSAD12ic ( DistParam* pcDtParam ); 315 313 static UInt xGetSAD24ic ( DistParam* pcDtParam ); … … 322 320 #endif 323 321 324 #if H_3D_IC || LGE_INTER_SDC_E0156322 #if H_3D_IC || H_3D_INTER_SDC 325 323 static UInt xGetHADsic ( DistParam* pcDtParam ); 326 324 #endif … … 343 341 #endif 344 342 345 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT343 #if (RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT) || KWU_RC_MADPRED_E0227 346 344 UInt getSADPart ( Int bitDepth, Pel* pelCur, Int curStride, Pel* pelOrg, Int orgStride, UInt width, UInt height ); 347 345 #endif -
TabularUnified trunk/source/Lib/TLibCommon/TComRom.cpp ¶
r622 r655 55 55 ::memset( g_aucConvertToBit, -1, sizeof( g_aucConvertToBit ) ); 56 56 c=0; 57 for ( i=4; i< MAX_CU_SIZE; i*=2 )57 for ( i=4; i<=MAX_CU_SIZE; i*=2 ) 58 58 { 59 59 g_aucConvertToBit[ i ] = c; 60 60 c++; 61 61 } 62 g_aucConvertToBit[ i ] = c;63 62 64 63 c=2; … … 292 291 293 292 #if FAST_UDI_USE_MPM 294 const UChar g_aucIntraModeNumFast[ 7] =293 const UChar g_aucIntraModeNumFast[MAX_CU_DEPTH] = 295 294 { 296 295 3, // 2x2 … … 299 298 3, // 16x16 300 299 3, // 32x32 301 3, // 64x64 302 3 // 128x128 300 3 // 64x64 303 301 }; 304 302 #else // FAST_UDI_USE_MPM 305 const UChar g_aucIntraModeNumFast[ 7] =303 const UChar g_aucIntraModeNumFast[MAX_CU_DEPTH] = 306 304 { 307 305 3, // 2x2 … … 310 308 4, // 16x16 33 311 309 4, // 32x32 33 312 5, // 64x64 33 313 4 // 128x128 33 310 5 // 64x64 33 314 311 }; 315 312 #endif // FAST_UDI_USE_MPM … … 347 344 { //2x2 4x4 8x8 16x16 32x32 64x64 348 345 0, 7, 10, 11, 11, 13 }; 349 #if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 346 350 347 const UChar g_dmm3IntraTabIdxBits[6] = 351 348 { //2x2 4x4 8x8 16x16 32x32 64x64 352 349 0, 4, 7, 8, 8, 0 }; 353 #else354 const UChar g_dmm3IntraTabIdxBits[6] =355 { //2x2 4x4 8x8 16x16 32x32 64x64356 0, 6, 9, 9, 9, 0 };357 #endif358 350 359 351 extern std::vector< std::vector<TComWedgelet> > g_dmmWedgeLists; … … 614 606 std::vector< std::vector< std::vector<UInt> > > g_aauiWdgLstM3; 615 607 616 #if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX617 608 Void initWedgeLists( Bool initNodeList ) 618 #else619 Void initWedgeLists( Bool initRefinements )620 #endif621 609 { 622 610 if( !g_dmmWedgeLists.empty() ) return; … … 631 619 g_dmmWedgeRefLists.push_back( acWedgeRefList ); 632 620 633 #if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX634 621 if( initNodeList ) 635 622 { 636 #endif 637 // create WedgeNodeList 638 std::vector<TComWedgeNode> acWedgeNodeList; 639 for( UInt uiPos = 0; uiPos < acWedgeList.size(); uiPos++ ) 640 { 641 if( acWedgeList[uiPos].getIsCoarse() ) 642 { 643 TComWedgeNode cWedgeNode; 644 cWedgeNode.setPatternIdx( uiPos ); 645 646 #if !LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 647 if( initRefinements ) 623 // create WedgeNodeList 624 std::vector<TComWedgeNode> acWedgeNodeList; 625 for( UInt uiPos = 0; uiPos < acWedgeList.size(); uiPos++ ) 626 { 627 if( acWedgeList[uiPos].getIsCoarse() ) 648 628 { 649 #endif 629 TComWedgeNode cWedgeNode; 630 cWedgeNode.setPatternIdx( uiPos ); 631 650 632 UInt uiRefPos = 0; 651 633 for( Int iOffS = -1; iOffS <= 1; iOffS++ ) … … 674 656 { 675 657 if( iSx == (Int)acWedgeRefList[k].getStartX() && 676 677 678 658 iSy == (Int)acWedgeRefList[k].getStartY() && 659 iEx == (Int)acWedgeRefList[k].getEndX() && 660 iEy == (Int)acWedgeRefList[k].getEndY() ) 679 661 { 680 662 if( acWedgeRefList[k].getRefIdx() != cWedgeNode.getPatternIdx() ) … … 694 676 } 695 677 } 696 #if !LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 678 acWedgeNodeList.push_back( cWedgeNode ); 697 679 } 698 #endif 699 acWedgeNodeList.push_back( cWedgeNode ); 700 } 701 } 702 g_dmmWedgeNodeLists.push_back( acWedgeNodeList ); 703 #if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 704 } 705 #endif 706 } 707 return; 680 } 681 g_dmmWedgeNodeLists.push_back( acWedgeNodeList ); 682 } 683 } 708 684 } 709 685 -
TabularUnified trunk/source/Lib/TLibCommon/TComRom.h ¶
r622 r655 56 56 // ==================================================================================================================== 57 57 58 #define MAX_CU_DEPTH 7// log2(LCUSize)58 #define MAX_CU_DEPTH 6 // log2(LCUSize) 59 59 #define MAX_CU_SIZE (1<<(MAX_CU_DEPTH)) // maximum allowable size of CU 60 60 #define MIN_PU_SIZE 4 … … 136 136 // ==================================================================================================================== 137 137 138 extern const UChar g_aucIntraModeNumFast[ 7];138 extern const UChar g_aucIntraModeNumFast[ MAX_CU_DEPTH ]; 139 139 140 140 // ==================================================================================================================== … … 174 174 extern std::vector< std::vector< std::vector<UInt> > > g_aauiWdgLstM3; 175 175 176 #if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX177 176 Void initWedgeLists( Bool initNodeList = false ); 178 #else179 Void initWedgeLists( Bool initRefinements = false );180 #endif181 177 Void createWedgeList( UInt uiWidth, UInt uiHeight, std::vector<TComWedgelet> &racWedgeList, std::vector<TComWedgeRef> &racWedgeRefList, WedgeResolution eWedgeRes ); 182 178 Void addWedgeletToList( TComWedgelet cWedgelet, std::vector<TComWedgelet> &racWedgeList, std::vector<TComWedgeRef> &racWedgeRefList ); -
TabularUnified trunk/source/Lib/TLibCommon/TComSlice.cpp ¶
r622 r655 101 101 , m_enableTMVPFlag ( true ) 102 102 #if H_MV 103 #if H_MV5104 103 , m_refPicSetInterLayer0 ( NULL ) 105 104 , m_refPicSetInterLayer1 ( NULL ) 106 #else107 , m_refPicSetInterLayer ( NULL )108 #endif109 105 , m_layerId (0) 110 106 , m_viewId (0) 111 #if H_MV5112 107 , m_viewIndex (0) 113 #endif114 108 #if H_3D 115 #if !H_MV5116 , m_viewIndex (0)117 #endif118 109 , m_isDepth (false) 119 110 #endif 120 #if H_MV5121 111 , m_pocResetFlag (false) 122 #endif123 112 , m_discardableFlag (false) 124 113 , m_interLayerPredEnabledFlag (false) 125 114 , m_numInterLayerRefPicsMinus1 (0) 126 #if !H_MV5127 , m_interLayerSamplePredOnlyFlag (false)128 , m_altCollocatedIndicationFlag (0)129 , m_collocatedRefLayerIdx (0)130 #endif131 115 #if H_3D_IC 132 116 , m_bApplyIC ( false ) … … 164 148 for (Int i = 0; i < MAX_NUM_LAYERS; i++ ) 165 149 { 166 #if H_MV5167 150 m_interLayerPredLayerIdc[ i ] = i; 168 #else169 m_interLayerPredLayerIdc[ i ] = 0;170 #endif171 151 } 172 152 #endif … … 322 302 if (!pocHasMsb) 323 303 { 324 poc = poc % pocCycle;304 poc = poc & (pocCycle - 1); 325 305 } 326 306 … … 333 313 if (!pocHasMsb) 334 314 { 335 picPoc = picPoc % pocCycle;315 picPoc = picPoc & (pocCycle - 1); 336 316 } 337 317 … … 387 367 } 388 368 } 389 #if H_MV5390 369 #if !H_MV 391 370 #if FIX1071 … … 472 451 { 473 452 // The variable NumPocTotalCurr is derived as specified in subclause 7.4.7.2. It is a requirement of bitstream conformance that the following applies to the value of NumPocTotalCurr: 474 // If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.475 // Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.453 // ?If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0. 454 // ?Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0. 476 455 if (getRapPicFlag()) 477 456 { … … 730 709 } 731 710 #endif 732 #else 711 Int TComSlice::getNumRpsCurrTempList() 712 { 713 Int numRpsCurrTempList = 0; 714 715 if (m_eSliceType == I_SLICE) 716 { 717 return 0; 718 } 719 for(UInt i=0; i < m_pcRPS->getNumberOfNegativePictures()+ m_pcRPS->getNumberOfPositivePictures() + m_pcRPS->getNumberOfLongtermPictures(); i++) 720 { 721 if(m_pcRPS->getUsed(i)) 722 { 723 numRpsCurrTempList++; 724 } 725 } 733 726 #if H_MV 734 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer , Bool checkNumPocTotalCurr)735 #else736 #if FIX1071737 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr )738 #else739 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic )740 #endif741 #endif742 {743 #if FIX1071744 if (!checkNumPocTotalCurr)745 #endif746 {747 if (m_eSliceType == I_SLICE)748 {749 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));750 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx ));751 752 return;753 }754 755 #if !H_MV756 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);757 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);758 #endif759 }760 761 TComPic* pcRefPic= NULL;762 TComPic* RefPicSetStCurr0[16];763 TComPic* RefPicSetStCurr1[16];764 TComPic* RefPicSetLtCurr[16];765 UInt NumPocStCurr0 = 0;766 UInt NumPocStCurr1 = 0;767 UInt NumPocLtCurr = 0;768 Int i;769 770 for(i=0; i < m_pcRPS->getNumberOfNegativePictures(); i++)771 {772 if(m_pcRPS->getUsed(i))773 {774 pcRefPic = xGetRefPic(rcListPic, getPOC()+m_pcRPS->getDeltaPOC(i));775 pcRefPic->setIsLongTerm(0);776 pcRefPic->getPicYuvRec()->extendPicBorder();777 RefPicSetStCurr0[NumPocStCurr0] = pcRefPic;778 NumPocStCurr0++;779 pcRefPic->setCheckLTMSBPresent(false);780 }781 }782 783 for(; i < m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures(); i++)784 {785 if(m_pcRPS->getUsed(i))786 {787 pcRefPic = xGetRefPic(rcListPic, getPOC()+m_pcRPS->getDeltaPOC(i));788 pcRefPic->setIsLongTerm(0);789 pcRefPic->getPicYuvRec()->extendPicBorder();790 RefPicSetStCurr1[NumPocStCurr1] = pcRefPic;791 NumPocStCurr1++;792 pcRefPic->setCheckLTMSBPresent(false);793 }794 }795 796 for(i = m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()+m_pcRPS->getNumberOfLongtermPictures()-1; i > m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()-1 ; i--)797 {798 if(m_pcRPS->getUsed(i))799 {800 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));801 pcRefPic->setIsLongTerm(1);802 pcRefPic->getPicYuvRec()->extendPicBorder();803 RefPicSetLtCurr[NumPocLtCurr] = pcRefPic;804 NumPocLtCurr++;805 }806 if(pcRefPic==NULL)807 {808 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));809 }810 pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i));811 }812 813 // ref_pic_list_init814 TComPic* rpsCurrList0[MAX_NUM_REF+1];815 TComPic* rpsCurrList1[MAX_NUM_REF+1];816 #if H_MV817 Int numPocInterCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr;818 assert( numPocInterCurr == 0 || getInterRefEnabledInRPLFlag() );819 Int numPocTotalCurr = numPocInterCurr + getNumActiveRefLayerPics( );820 assert( numPocTotalCurr == getNumRpsCurrTempList() );821 #else822 Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr;823 #endif824 #if FIX1071825 if (checkNumPocTotalCurr)826 {827 // The variable NumPocTotalCurr is derived as specified in subclause 7.4.7.2. It is a requirement of bitstream conformance that the following applies to the value of NumPocTotalCurr:828 #if H_MV829 // â If nuh_layer_id is equal to 0 and the current picture is a BLA picture or a CRA picture, the value of NumPocTotalCurr shall be equal to 0.830 // â Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.831 if ( getRapPicFlag() && m_layerId == 0 )832 #else833 // â If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.834 // â Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.835 if (getRapPicFlag())836 #endif837 {838 assert(numPocTotalCurr == 0);839 }840 841 if (m_eSliceType == I_SLICE)842 {843 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));844 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx ));845 846 return;847 }848 849 assert(numPocTotalCurr > 0);850 851 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);852 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);853 }854 #endif855 856 Int cIdx = 0;857 #if H_MV858 if ( getInterRefEnabledInRPLFlag() )859 {860 #endif861 for ( i=0; i<NumPocStCurr0; i++, cIdx++)862 {863 rpsCurrList0[cIdx] = RefPicSetStCurr0[i];864 }865 for ( i=0; i<NumPocStCurr1; i++, cIdx++)866 {867 rpsCurrList0[cIdx] = RefPicSetStCurr1[i];868 }869 for ( i=0; i<NumPocLtCurr; i++, cIdx++)870 {871 rpsCurrList0[cIdx] = RefPicSetLtCurr[i];872 }873 #if H_MV874 }875 for ( i=0; i < getNumActiveRefLayerPics( ); i++, cIdx++)876 {877 assert( cIdx < MAX_NUM_REF );878 rpsCurrList0[cIdx] = refPicSetInterLayer[i];879 }880 #endif881 assert(cIdx == numPocTotalCurr);882 883 if (m_eSliceType==B_SLICE)884 {885 cIdx = 0;886 #if H_MV887 if ( getInterRefEnabledInRPLFlag() )888 {889 #endif890 for ( i=0; i<NumPocStCurr1; i++, cIdx++)891 {892 rpsCurrList1[cIdx] = RefPicSetStCurr1[i];893 }894 for ( i=0; i<NumPocStCurr0; i++, cIdx++)895 {896 rpsCurrList1[cIdx] = RefPicSetStCurr0[i];897 }898 for ( i=0; i<NumPocLtCurr; i++, cIdx++)899 {900 rpsCurrList1[cIdx] = RefPicSetLtCurr[i];901 }902 #if H_MV903 }904 for ( i=0; i < getNumActiveRefLayerPics( ); i++, cIdx++)905 {906 assert( cIdx < MAX_NUM_REF );907 rpsCurrList1[cIdx] = refPicSetInterLayer[i];908 }909 #endif910 assert(cIdx == numPocTotalCurr);911 }912 913 ::memset(m_bIsUsedAsLongTerm, 0, sizeof(m_bIsUsedAsLongTerm));914 915 #if H_MV916 Int numPocSt = NumPocStCurr0 + NumPocStCurr1;917 assert( getInterRefEnabledInRPLFlag( ) || numPocSt == 0 );918 919 for (Int li = 0; li < 2; li++)920 {921 if ( m_eSliceType == P_SLICE && li == 1 )922 {923 m_aiNumRefIdx[1] = 0;924 ::memset( m_apcRefPicList[1], 0, sizeof(m_apcRefPicList[1]));925 }926 else927 {928 for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[ li ] - 1 ); rIdx ++)929 {930 Bool listModified = m_RefPicListModification.getRefPicListModificationFlagL( li );931 Int orgIdx = listModified ? m_RefPicListModification.getRefPicSetIdxL(li, rIdx) : (rIdx % numPocTotalCurr);932 933 m_apcRefPicList [li][rIdx] = ( li == 0 ) ? rpsCurrList0[ orgIdx ] : rpsCurrList1[ orgIdx ];934 m_bIsUsedAsLongTerm[li][rIdx] = ( orgIdx >= numPocSt ) ;935 }936 }937 }938 #else939 for (Int rIdx = 0; rIdx < m_aiNumRefIdx[0]; rIdx ++)940 {941 cIdx = m_RefPicListModification.getRefPicListModificationFlagL0() ? m_RefPicListModification.getRefPicSetIdxL0(rIdx) : rIdx % numPocTotalCurr;942 assert(cIdx >= 0 && cIdx < numPocTotalCurr);943 m_apcRefPicList[0][rIdx] = rpsCurrList0[ cIdx ];944 m_bIsUsedAsLongTerm[0][rIdx] = ( cIdx >= NumPocStCurr0 + NumPocStCurr1 );945 }946 if ( m_eSliceType != B_SLICE )947 {948 m_aiNumRefIdx[1] = 0;949 ::memset( m_apcRefPicList[1], 0, sizeof(m_apcRefPicList[1]));950 }951 else952 {953 for (Int rIdx = 0; rIdx < m_aiNumRefIdx[1]; rIdx ++)954 {955 cIdx = m_RefPicListModification.getRefPicListModificationFlagL1() ? m_RefPicListModification.getRefPicSetIdxL1(rIdx) : rIdx % numPocTotalCurr;956 assert(cIdx >= 0 && cIdx < numPocTotalCurr);957 m_apcRefPicList[1][rIdx] = rpsCurrList1[ cIdx ];958 m_bIsUsedAsLongTerm[1][rIdx] = ( cIdx >= NumPocStCurr0 + NumPocStCurr1 );959 }960 }961 #endif962 }963 964 #endif965 Int TComSlice::getNumRpsCurrTempList()966 {967 Int numRpsCurrTempList = 0;968 969 if (m_eSliceType == I_SLICE)970 {971 return 0;972 }973 for(UInt i=0; i < m_pcRPS->getNumberOfNegativePictures()+ m_pcRPS->getNumberOfPositivePictures() + m_pcRPS->getNumberOfLongtermPictures(); i++)974 {975 if(m_pcRPS->getUsed(i))976 {977 numRpsCurrTempList++;978 }979 }980 #if H_MV981 #if !H_MV5982 assert( ( numRpsCurrTempList == 0 ) || getInterRefEnabledInRPLFlag() );983 #endif984 727 numRpsCurrTempList = numRpsCurrTempList + getNumActiveRefLayerPics(); 985 728 #endif … … 1063 806 } 1064 807 1065 Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic)808 Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic) 1066 809 { 1067 810 for(Int i = 0; i < pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures(); i++) … … 1089 832 { 1090 833 pocCRA = getPOC(); 1091 prevRAPisBLA = false;834 associatedIRAPType = getNalUnitType(); 1092 835 } 1093 836 else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ) // CRA picture found 1094 837 { 1095 838 pocCRA = getPOC(); 1096 prevRAPisBLA = false;839 associatedIRAPType = getNalUnitType(); 1097 840 } 1098 841 else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP … … 1101 844 { 1102 845 pocCRA = getPOC(); 1103 prevRAPisBLA = true;846 associatedIRAPType = getNalUnitType(); 1104 847 } 1105 848 } … … 1126 869 { 1127 870 TComPic* rpcPic; 871 setAssociatedIRAPPOC(pocCRA); 1128 872 Int pocCurr = getPOC(); 1129 873 … … 1295 1039 #if H_MV 1296 1040 // Additional slice header syntax elements 1297 #if H_MV51298 1041 m_pocResetFlag = pSrc->m_pocResetFlag; 1299 #endif1300 1042 m_discardableFlag = pSrc->m_discardableFlag; 1301 1043 m_interLayerPredEnabledFlag = pSrc->m_interLayerPredEnabledFlag; … … 1306 1048 m_interLayerPredLayerIdc[ layer ] = pSrc->m_interLayerPredLayerIdc[ layer ]; 1307 1049 } 1308 #if !H_MV51309 m_interLayerSamplePredOnlyFlag = pSrc->m_interLayerSamplePredOnlyFlag;1310 m_altCollocatedIndicationFlag = pSrc->m_altCollocatedIndicationFlag ;1311 m_collocatedRefLayerIdx = pSrc->m_collocatedRefLayerIdx ;1312 m_numActiveMotionPredRefLayers = pSrc->m_numActiveMotionPredRefLayers;1313 1314 for (Int layer = 0; layer < MAX_NUM_LAYER_IDS; layer++)1315 {1316 m_interLayerPredLayerIdc[layer] = pSrc->m_interLayerPredLayerIdc[layer];1317 }1318 #endif1319 1050 #endif 1320 1051 #if H_3D_IC … … 1324 1055 } 1325 1056 1326 Int TComSlice::m_prev POC = 0;1057 Int TComSlice::m_prevTid0POC = 0; 1327 1058 1328 1059 /** Function for setting the slice's temporal layer ID and corresponding temporal_layer_switching_point_flag. … … 1379 1110 } 1380 1111 1112 1113 Void TComSlice::checkLeadingPictureRestrictions(TComList<TComPic*>& rcListPic) 1114 { 1115 TComPic* rpcPic; 1116 1117 Int nalUnitType = this->getNalUnitType(); 1118 1119 // When a picture is a leading picture, it shall be a RADL or RASL picture. 1120 if(this->getAssociatedIRAPPOC() > this->getPOC()) 1121 { 1122 // Do not check IRAP pictures since they may get a POC lower than their associated IRAP 1123 if(nalUnitType < NAL_UNIT_CODED_SLICE_BLA_W_LP || 1124 nalUnitType > NAL_UNIT_RESERVED_IRAP_VCL23) 1125 { 1126 assert(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || 1127 nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R || 1128 nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || 1129 nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R); 1130 } 1131 } 1132 1133 // When a picture is a trailing picture, it shall not be a RADL or RASL picture. 1134 if(this->getAssociatedIRAPPOC() < this->getPOC()) 1135 { 1136 assert(nalUnitType != NAL_UNIT_CODED_SLICE_RASL_N && 1137 nalUnitType != NAL_UNIT_CODED_SLICE_RASL_R && 1138 nalUnitType != NAL_UNIT_CODED_SLICE_RADL_N && 1139 nalUnitType != NAL_UNIT_CODED_SLICE_RADL_R); 1140 } 1141 1142 // No RASL pictures shall be present in the bitstream that are associated 1143 // with a BLA picture having nal_unit_type equal to BLA_W_RADL or BLA_N_LP. 1144 if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || 1145 nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R) 1146 { 1147 assert(this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_BLA_W_RADL && 1148 this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_BLA_N_LP); 1149 } 1150 1151 // No RASL pictures shall be present in the bitstream that are associated with 1152 // an IDR picture. 1153 if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || 1154 nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R) 1155 { 1156 assert(this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_IDR_N_LP && 1157 this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_IDR_W_RADL); 1158 } 1159 1160 // No RADL pictures shall be present in the bitstream that are associated with 1161 // a BLA picture having nal_unit_type equal to BLA_N_LP or that are associated 1162 // with an IDR picture having nal_unit_type equal to IDR_N_LP. 1163 if(nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || 1164 nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R) 1165 { 1166 assert(this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_BLA_N_LP && 1167 this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_IDR_N_LP); 1168 } 1169 1170 // loop through all pictures in the reference picture buffer 1171 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 1172 while ( iterPic != rcListPic.end()) 1173 { 1174 rpcPic = *(iterPic++); 1175 if (rpcPic->getPOC() == this->getPOC()) 1176 { 1177 continue; 1178 } 1179 1180 // Any picture that has PicOutputFlag equal to 1 that precedes an IRAP picture 1181 // in decoding order shall precede the IRAP picture in output order. 1182 // (Note that any picture following in output order would be present in the DPB) 1183 if(rpcPic->getSlice(0)->getPicOutputFlag() == 1) 1184 { 1185 if(nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP || 1186 nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP || 1187 nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL || 1188 nalUnitType == NAL_UNIT_CODED_SLICE_CRA || 1189 nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP || 1190 nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL) 1191 { 1192 assert(rpcPic->getPOC() < this->getPOC()); 1193 } 1194 } 1195 1196 // Any picture that has PicOutputFlag equal to 1 that precedes an IRAP picture 1197 // in decoding order shall precede any RADL picture associated with the IRAP 1198 // picture in output order. 1199 if(rpcPic->getSlice(0)->getPicOutputFlag() == 1) 1200 { 1201 if((nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || 1202 nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R)) 1203 { 1204 // rpcPic precedes the IRAP in decoding order 1205 if(this->getAssociatedIRAPPOC() > rpcPic->getSlice(0)->getAssociatedIRAPPOC()) 1206 { 1207 // rpcPic must not be the IRAP picture 1208 if(this->getAssociatedIRAPPOC() != rpcPic->getPOC()) 1209 { 1210 assert(rpcPic->getPOC() < this->getPOC()); 1211 } 1212 } 1213 } 1214 } 1215 1216 // When a picture is a leading picture, it shall precede, in decoding order, 1217 // all trailing pictures that are associated with the same IRAP picture. 1218 if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || 1219 nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R || 1220 nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || 1221 nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R) 1222 { 1223 if(rpcPic->getSlice(0)->getAssociatedIRAPPOC() == this->getAssociatedIRAPPOC()) 1224 { 1225 // rpcPic is a picture that preceded the leading in decoding order since it exist in the DPB 1226 // rpcPic would violate the constraint if it was a trailing picture 1227 assert(rpcPic->getPOC() <= this->getAssociatedIRAPPOC()); 1228 } 1229 } 1230 1231 // Any RASL picture associated with a CRA or BLA picture shall precede any 1232 // RADL picture associated with the CRA or BLA picture in output order 1233 if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || 1234 nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R) 1235 { 1236 if((this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_N_LP || 1237 this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_W_LP || 1238 this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL || 1239 this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_CRA) && 1240 this->getAssociatedIRAPPOC() == rpcPic->getSlice(0)->getAssociatedIRAPPOC()) 1241 { 1242 if(rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N || 1243 rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R) 1244 { 1245 assert(rpcPic->getPOC() > this->getPOC()); 1246 } 1247 } 1248 } 1249 1250 // Any RASL picture associated with a CRA picture shall follow, in output 1251 // order, any IRAP picture that precedes the CRA picture in decoding order. 1252 if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || 1253 nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R) 1254 { 1255 if(this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_CRA) 1256 { 1257 if(rpcPic->getSlice(0)->getPOC() < this->getAssociatedIRAPPOC() && 1258 (rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP || 1259 rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP || 1260 rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL || 1261 rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || 1262 rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || 1263 rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA)) 1264 { 1265 assert(this->getPOC() > rpcPic->getSlice(0)->getPOC()); 1266 } 1267 } 1268 } 1269 } 1270 } 1271 1272 1273 1381 1274 /** Function for applying picture marking based on the Reference Picture Set in pReferencePictureSet. 1382 1275 */ … … 1385 1278 TComPic* rpcPic; 1386 1279 Int i, isReference; 1280 1281 checkLeadingPictureRestrictions(rcListPic); 1387 1282 1388 1283 // loop through all pictures in the reference picture buffer … … 1421 1316 else 1422 1317 { 1423 if(rpcPic->getIsLongTerm() && (rpcPic->getPicSym()->getSlice(0)->getPOC()%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC())) == pReferencePictureSet->getPOC(i)%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC())) 1318 Int pocCycle = 1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC(); 1319 Int curPoc = rpcPic->getPicSym()->getSlice(0)->getPOC() & (pocCycle-1); 1320 Int refPoc = pReferencePictureSet->getPOC(i) & (pocCycle-1); 1321 if(rpcPic->getIsLongTerm() && curPoc == refPoc) 1424 1322 { 1425 1323 isReference = 1; … … 1481 1379 else 1482 1380 { 1483 if(rpcPic->getIsLongTerm() && (rpcPic->getPicSym()->getSlice(0)->getPOC()%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC())) == pReferencePictureSet->getPOC(i)%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC()) && rpcPic->getSlice(0)->isReferenced()) 1381 Int pocCycle = 1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC(); 1382 Int curPoc = rpcPic->getPicSym()->getSlice(0)->getPOC() & (pocCycle-1); 1383 Int refPoc = pReferencePictureSet->getPOC(i) & (pocCycle-1); 1384 if(rpcPic->getIsLongTerm() && curPoc == refPoc && rpcPic->getSlice(0)->isReferenced()) 1484 1385 { 1485 1386 isAvailable = 1; … … 1500 1401 if (!pReferencePictureSet->getCheckLTMSBPresent(i)) 1501 1402 { 1502 curPoc = curPoc % pocCycle;1503 refPoc = refPoc % pocCycle;1403 curPoc = curPoc & (pocCycle - 1); 1404 refPoc = refPoc & (pocCycle - 1); 1504 1405 } 1505 1406 … … 1781 1682 : m_VPSId ( 0) 1782 1683 , m_uiMaxTLayers ( 1) 1783 #if H_MV51784 1684 #if H_MV 1785 1685 , m_uiMaxLayersMinus1 ( 0) 1786 #else1787 , m_uiMaxLayers ( 1)1788 #endif1789 1686 #else 1790 1687 , m_uiMaxLayers ( 1) … … 1800 1697 , m_hrdOpSetIdx (NULL) 1801 1698 , m_cprmsPresentFlag (NULL) 1802 #if H_MV51803 1699 #if H_MV 1804 1700 , m_vpsVUI ( NULL ) 1805 #endif1806 1701 #endif 1807 1702 { … … 1848 1743 1849 1744 m_avcBaseLayerFlag = false; 1850 #if H_MV51851 1745 m_vpsVuiOffset = 0; 1852 #endif1853 1746 m_splittingFlag = false; 1854 1747 1855 1748 for( Int i = 0; i < MAX_NUM_SCALABILITY_TYPES; i++ ) 1856 1749 { 1857 #if H_MV51858 1750 m_scalabilityMaskFlag[i] = false; 1859 #else1860 m_scalabilityMask[i] = false;1861 #endif1862 1751 m_dimensionIdLen [i] = -1; 1863 1752 } … … 1885 1774 m_layerIdInNuh [i] = ( i == 0 ) ? 0 : -1; 1886 1775 m_numDirectRefLayers[i] = 0; 1887 #if H_MV51888 1776 m_maxTidIlRefPicPlus1[i] = 7; 1889 1777 m_vpsRepFormatIdx [i] = 0; 1890 1778 m_repFormat [i] = NULL; 1891 1779 m_viewIdVal [i] = 0; 1892 #else1893 m_maxTidIlRefPicPlus1[i] = -1;1894 #endif1895 1780 1896 1781 #if H_3D … … 1935 1820 #endif 1936 1821 } 1937 #if H_MV51938 1822 m_vpsVUI = new TComVPSVUI; 1939 #endif1940 1823 #if H_3D 1941 1824 for( Int i = 0; i < MAX_NUM_LAYERS; i++ ) … … 1950 1833 m_depthRefinementFlag [ i ] = false; 1951 1834 #endif 1952 #if LGE_INTER_SDC_E01561835 #if H_3D_INTER_SDC 1953 1836 m_bInterSDCFlag [ i ] = false; 1954 1837 #endif … … 1963 1846 if( m_hrdOpSetIdx != NULL ) delete[] m_hrdOpSetIdx; 1964 1847 if( m_cprmsPresentFlag != NULL ) delete[] m_cprmsPresentFlag; 1965 #if H_MV51966 1848 #if H_MV 1967 1849 if ( m_vpsVUI != NULL ) delete m_vpsVUI; … … 1983 1865 #endif 1984 1866 } 1985 #endif1986 #else1987 #if H_3D_DIM_DLT1988 for( Int i = 0; i < MAX_NUM_LAYERS; i++ )1989 {1990 if ( m_iDepthValue2Idx[i] != 0 )1991 {1992 xFree( m_iDepthValue2Idx[i] );1993 m_iDepthValue2Idx[i] = 0;1994 }1995 1996 if ( m_iIdx2DepthValue[i] != 0 )1997 {1998 xFree( m_iIdx2DepthValue[i] );1999 m_iIdx2DepthValue[i] = 0;2000 2001 }2002 }2003 #endif2004 1867 #endif 2005 1868 } … … 2072 1935 Bool TComVPS::checkVPSExtensionSyntax() 2073 1936 { 2074 #if H_MV52075 1937 for( Int layer = 1; layer <= getMaxLayersMinus1(); layer++ ) 2076 #else2077 for( Int layer = 1; layer < getMaxLayers(); layer++ )2078 #endif2079 1938 { 2080 1939 // check layer_id_in_nuh constraint … … 2092 1951 { 2093 1952 assert( scalType >= 0 && scalType <= MAX_NUM_SCALABILITY_TYPES ); 2094 #if H_MV52095 1953 assert( scalType == MAX_NUM_SCALABILITY_TYPES || getScalabilityMaskFlag( scalType ) ); 2096 #else2097 assert( scalType == MAX_NUM_SCALABILITY_TYPES || getScalabilityMask( scalType ) );2098 #endif2099 1954 Int scalIdx = 0; 2100 1955 for( Int curScalType = 0; curScalType < scalType; curScalType++ ) 2101 1956 { 2102 #if H_MV52103 1957 scalIdx += ( getScalabilityMaskFlag( curScalType ) ? 1 : 0 ); 2104 #else2105 scalIdx += ( getScalabilityMask( curScalType ) ? 1 : 0 );2106 #endif2107 1958 2108 1959 } … … 2110 1961 return scalIdx; 2111 1962 } 2112 #if H_MV52113 1963 Void TComVPS::setScalabilityMaskFlag( UInt val ) 2114 1964 { … … 2118 1968 } 2119 1969 } 2120 #else 2121 Void TComVPS::setScalabilityMask( UInt val ) 2122 { 2123 for ( Int scalType = 0; scalType < MAX_NUM_SCALABILITY_TYPES; scalType++ ) 2124 setScalabilityMask( scalType, ( val & (1 << scalType ) ) != 0 ); 2125 } 2126 2127 #endif 2128 2129 #if H_MV5 1970 2130 1971 Void TComVPS::setRefLayers() 2131 1972 { … … 2176 2017 } 2177 2018 #endif // H_3D 2178 #else2179 Void TComVPS::setRefLayers()2180 {2181 for( Int i = 0; i < MAX_NUM_LAYERS; i++ )2182 {2183 m_numSamplePredRefLayers[ i ] = 0;2184 m_numMotionPredRefLayers[ i ] = 0;2185 m_numDirectRefLayers[ i ] = 0;2186 for( Int j = 0; j < MAX_NUM_LAYERS; j++ ) {2187 m_samplePredEnabledFlag[ i ][ j ] = 0;2188 m_motionPredEnabledFlag[ i ][ j ] = 0;2189 m_refLayerId[ i ][ j ] = 0;2190 m_samplePredRefLayerId[ i ][ j ] = 0;2191 m_motionPredRefLayerId[ i ][ j ] = 0;2192 }2193 }2194 2195 for( Int i = 1; i <= getMaxLayers()- 1; i++ )2196 {2197 for( Int j = 0; j < i; j++ )2198 {2199 if( getDirectDependencyFlag(i,j) )2200 {2201 m_refLayerId[ i ][m_numDirectRefLayers[ i ]++ ] = getLayerIdInNuh( j );2202 2203 m_samplePredEnabledFlag [ i ][ j ] = ( ( getDirectDependencyType( i , j ) + 1 ) & 1 ) == 1;2204 m_numSamplePredRefLayers[ i ] += m_samplePredEnabledFlag [ i ][ j ] ? 1 : 0;2205 m_motionPredEnabledFlag [ i ][ j ] = ( ( ( getDirectDependencyType( i , j ) + 1 ) & 2 ) >> 1 ) == 1;2206 m_numMotionPredRefLayers[ i ] += m_motionPredEnabledFlag [ i][ j ] ? 1 : 0;2207 }2208 }2209 }2210 2211 for( Int i = 1, mIdx = 0, sIdx = 0; i <= getMaxLayers()- 1; i++ )2212 {2213 for( Int j = 0 ; j < i; j++ )2214 {2215 if( m_motionPredEnabledFlag[ i ][ j ] )2216 {2217 m_motionPredRefLayerId[ i ][ mIdx++ ] = getLayerIdInNuh( j );2218 }2219 2220 if( m_samplePredEnabledFlag[ i ][ j ] )2221 {2222 m_samplePredRefLayerId[ i ][ sIdx++ ] = getLayerIdInNuh( j );2223 }2224 }2225 }2226 }2227 2228 Int TComVPS::getRefLayerId( Int layerIdInVps, Int idx )2229 {2230 assert( idx >= 0 && idx < m_numDirectRefLayers[layerIdInVps] );2231 Int layerIdInNuh = m_refLayerId[ layerIdInVps ][ idx ];2232 assert ( layerIdInNuh >= 0 );2233 return layerIdInNuh;2234 }2235 2236 Int TComVPS::getScalabilityId( Int layerIdInVps, ScalabilityType scalType )2237 {2238 return getScalabilityMask( scalType ) ? getDimensionId( layerIdInVps, scalTypeToScalIdx( scalType ) ) : 0;2239 }2240 2241 #if H_3D2242 Void TComVPS::initViewIndex()2243 {2244 Int viewIdList [ MAX_NUM_LAYERS ]; // ed. should be changed to MAX_VIEW_ID2245 Int viewIndexList[ MAX_NUM_LAYERS ];2246 Int numViewIds = 0;2247 2248 for ( Int i = 0 ; i < m_uiMaxLayers; i++ )2249 {2250 Int currViewId = getViewId( i );2251 2252 Bool viewIdInListFlag = false;2253 for ( Int j = 0; j < numViewIds; j ++ )2254 {2255 viewIdInListFlag = viewIdInListFlag || ( currViewId == viewIdList[ j ] );2256 }2257 2258 if ( !viewIdInListFlag )2259 {2260 viewIdList [ numViewIds ] = currViewId;2261 viewIndexList[ currViewId ] = numViewIds;2262 2263 numViewIds++;2264 }2265 2266 m_viewIndex[ i ] = viewIndexList[ currViewId ];2267 }2268 }2269 2270 Int TComVPS::getLayerIdInNuh( Int viewIndex, Bool depthFlag )2271 {2272 Int foundlayerId = -1;2273 2274 for (Int layer = 0 ; layer < m_uiMaxLayers; layer++ )2275 {2276 if( ( getViewIndex( layer ) == viewIndex ) && ( getDepthId( layer ) == ( depthFlag ? 1 : 0 ) ) )2277 {2278 foundlayerId = layer;2279 break;2280 }2281 }2282 assert( foundlayerId != -1 );2283 2284 return getLayerIdInNuh( foundlayerId );2285 }2286 2287 #endif // H_3D2288 2289 Int TComVPS::xCeilLog2( Int val )2290 {2291 assert( val > 0 );2292 Int ceilLog2 = 0;2293 while( val > ( 1 << ceilLog2 ) ) ceilLog2++;2294 return ceilLog2;2295 }2296 2297 #endif // H_MV52298 2019 2299 2020 … … 2336 2057 return numLayersInIdList; 2337 2058 } 2338 #if H_MV52339 2059 Int TComVPS::getNumViews() 2340 2060 { … … 2366 2086 return dependentFlag; 2367 2087 } 2368 #endif2369 2088 #endif // H_MV 2370 2089 … … 2417 2136 , m_vuiParameters () 2418 2137 #if H_MV 2419 #if H_MV52420 2138 , m_pcVPS ( NULL ) 2421 2139 , m_spsInferScalingListFlag ( false ) … … 2423 2141 , m_updateRepFormatFlag ( true ) 2424 2142 , m_interViewMvVertConstraintFlag (false) 2425 #else2426 , m_interViewMvVertConstraintFlag (false)2427 , m_numIlpRestrictedRefLayers ( 0 )2428 #endif2429 2143 #endif 2430 2144 #if H_3D … … 2441 2155 ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps)); 2442 2156 ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag)); 2443 #if !H_MV52444 #if H_MV2445 for (Int i = 0; i < MAX_NUM_LAYERS; i++ )2446 {2447 m_minSpatialSegmentOffsetPlus1[ i ] = 0;2448 m_ctuBasedOffsetEnabledFlag [ i ] = false;2449 m_minHorizontalCtuOffsetPlus1 [ i ] = 0;2450 }2451 #endif2452 #endif2453 2157 } 2454 2158 … … 2603 2307 , m_listsModificationPresentFlag( 0) 2604 2308 , m_numExtraSliceHeaderBits(0) 2605 #if H_MV52606 2309 #if H_MV 2607 2310 , m_ppsInferScalingListFlag(false) 2608 2311 , m_ppsScalingListRefLayerId(0) 2609 2312 #endif 2610 #endif2611 2313 { 2612 2314 m_scalingList = new TComScalingList; … … 2628 2330 } 2629 2331 2630 #if H_MV52631 2332 #if H_MV 2632 2333 Void TComSPS::inferRepFormat( TComVPS* vps, Int layerIdCurr ) … … 2679 2380 } 2680 2381 } 2681 #endif2682 2382 #endif 2683 2383 #if H_3D … … 2908 2608 TComScalingList::TComScalingList() 2909 2609 { 2910 m_useTransformSkip = false;2911 2610 init(); 2912 2611 } … … 2950 2649 2951 2650 #if H_MV 2952 #if H_MV52953 2651 Void TComSlice::createInterLayerReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1 ) 2954 2652 { … … 2982 2680 } 2983 2681 } 2984 #else 2985 Void TComSlice::createAndApplyIvReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer ) 2986 { 2987 refPicSetInterLayer.clear(); 2988 2989 for( Int i = 0; i < getNumActiveRefLayerPics(); i++ ) 2990 { 2991 Int layerIdRef = getRefPicLayerId( i ); 2992 TComPic* picRef = ivPicLists->getPic( layerIdRef, getPOC() ) ; 2993 assert ( picRef != 0 ); 2994 2995 picRef->getPicYuvRec()->extendPicBorder(); 2996 picRef->setIsLongTerm( true ); 2997 picRef->getSlice(0)->setReferenced( true ); 2998 2999 // Consider to check here: 3000 // "If the current picture is a RADL picture, there shall be no entry in the RefPicSetInterLayer that is a RASL picture. " 3001 refPicSetInterLayer.push_back( picRef ); 3002 } 3003 } 3004 #endif 3005 3006 #if H_MV5 2682 3007 2683 Void TComSlice::markIvRefPicsAsShortTerm( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 ) 3008 2684 { … … 3019 2695 3020 2696 } 3021 #else3022 Void TComSlice::markIvRefPicsAsShortTerm( std::vector<TComPic*> refPicSetInterLayer )3023 {3024 // Mark as shortterm3025 for ( Int i = 0; i < refPicSetInterLayer.size(); i++ )3026 {3027 refPicSetInterLayer[i]->setIsLongTerm( false );3028 }3029 }3030 3031 #endif3032 2697 Void TComSlice::markIvRefPicsAsUnused( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc ) 3033 2698 { … … 3035 2700 if (targetDecLayerIdSet.size() == 0 ) 3036 2701 { 3037 #if H_MV53038 2702 for ( Int layerIdInVps = 0; layerIdInVps <= vps->getMaxLayersMinus1(); layerIdInVps++ ) 3039 #else3040 for ( Int layerIdInVps = 0; layerIdInVps < vps->getMaxLayers(); layerIdInVps++ )3041 #endif3042 2703 { 3043 2704 targetDecLayerIdSet.push_back( vps->getLayerIdInNuh( layerIdInVps ) ); … … 3068 2729 if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ j ] ) ) 3069 2730 { 3070 #if H_MV53071 2731 for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdSet[ j ] ); k++ ) 3072 2732 { 3073 2733 if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdSet[ j ], k ) ) 3074 #else3075 Int targetDecLayerIdinVPS = vpsSlice->getLayerIdInVps( targetDecLayerIdSet[ j ] );3076 for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdinVPS ); k++ )3077 {3078 if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdinVPS, k ) )3079 #endif3080 2734 { 3081 2735 remainingInterLayerReferencesFlag = true; … … 3093 2747 } 3094 2748 3095 #if H_MV53096 2749 Void TComSlice::printRefPicList() 3097 #else3098 Void TComSlice::xPrintRefPicList()3099 #endif3100 2750 { 3101 2751 for ( Int li = 0; li < 2; li++) … … 3110 2760 } 3111 2761 } 3112 #if !H_MV53113 Int TComSlice::xCeilLog2( Int val )3114 {3115 assert( val > 0 );3116 Int ceilLog2 = 0;3117 while( val > ( 1 << ceilLog2 ) ) ceilLog2++;3118 return ceilLog2;3119 }3120 #endif3121 2762 3122 2763 Void TComSlice::markCurrPic( TComPic* currPic ) … … 3133 2774 } 3134 2775 3135 #if H_MV53136 2776 Void TComSlice::setRefPicSetInterLayer( std::vector<TComPic*>* refPicSetInterLayer0, std::vector<TComPic*>* refPicSetInterLayer1 ) 3137 2777 { … … 3158 2798 return pcPic; 3159 2799 } 3160 #else3161 Void TComSlice::setRefPicSetInterLayer( std::vector<TComPic*>* refPicSetInterLayer )3162 {3163 m_refPicSetInterLayer = refPicSetInterLayer;3164 }3165 3166 TComPic* TComSlice::getPicFromRefPicSetInterLayer( Int layerId )3167 {3168 assert( m_refPicSetInterLayer != 0 );3169 assert( (*m_refPicSetInterLayer).size() == getNumActiveRefLayerPics() );3170 TComPic* pcPic = NULL;3171 for ( Int i = 0; i < getNumActiveRefLayerPics(); i++ )3172 {3173 if ((*m_refPicSetInterLayer)[ i ]->getLayerId() == layerId)3174 {3175 pcPic = (*m_refPicSetInterLayer)[ i ];3176 }3177 }3178 assert(pcPic != NULL);3179 return pcPic;3180 }3181 #endif3182 2800 Int TComSlice::getNumActiveRefLayerPics() 3183 2801 { 3184 2802 Int numActiveRefLayerPics; 3185 2803 3186 #if H_MV53187 2804 if( getLayerId() == 0 || getVPS()->getNumDirectRefLayers( getLayerId() ) == 0 ) 3188 2805 { … … 3198 2815 } 3199 2816 else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerId() ) == 1 ) 3200 #else3201 if( getLayerId() == 0 || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) == 0 || !getInterLayerPredEnabledFlag() )3202 {3203 numActiveRefLayerPics = 0;3204 }3205 else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) == 1 )3206 #endif3207 2817 { 3208 2818 numActiveRefLayerPics = 1; … … 3217 2827 Int TComSlice::getRefPicLayerId( Int i ) 3218 2828 { 3219 #if H_MV53220 2829 return getVPS()->getRefLayerId( getLayerId(), getInterLayerPredLayerIdc( i ) ); 3221 #else 3222 return getVPS()->getRefLayerId( getLayerIdInVps(), getInterLayerPredLayerIdc( i ) ); 3223 #endif 3224 } 3225 3226 #if !H_MV5 3227 Void TComSlice::setActiveMotionPredRefLayers() 3228 { 3229 Int j = 0; 3230 for( Int i = 0; i < getNumActiveRefLayerPics(); i++) 3231 { 3232 if( getVPS()->getMotionPredEnabledFlag( getLayerIdInVps(), getInterLayerPredLayerIdc( i )) ) 3233 { 3234 m_activeMotionPredRefLayerId[ j++ ] = getVPS()->getRefLayerId( getLayerIdInVps(), i ); 3235 } 3236 } 3237 m_numActiveMotionPredRefLayers = j; 3238 3239 // Consider incorporating bitstream conformance tests on derived variables here. 3240 } 3241 3242 Bool TComSlice::getInterRefEnabledInRPLFlag() 3243 { 3244 Bool interRefEnabledInRPLFlag; 3245 if ( getVPS()->getNumSamplePredRefLayers( getLayerIdInVps() ) > 0 && getNumActiveRefLayerPics() > 0 ) 3246 { 3247 interRefEnabledInRPLFlag = !getInterLayerSamplePredOnlyFlag(); 3248 } 3249 else 3250 { 3251 interRefEnabledInRPLFlag = 1; 3252 } 3253 return interRefEnabledInRPLFlag; 3254 } 3255 #endif 2830 } 2831 3256 2832 #if H_3D_ARP 3257 2833 Void TComSlice::setARPStepNum() … … 3531 3107 } 3532 3108 3533 #if H_MV53534 3109 #if H_MV 3535 3110 Void TComScalingList::inferFrom( TComScalingList* srcScLi ) … … 3545 3120 } 3546 3121 } 3547 #endif3548 3122 #endif 3549 3123 /** initialization process of quantization matrix array … … 3636 3210 , m_ppsMap(MAX_NUM_PPS) 3637 3211 , m_activeVPSId(-1) 3638 #if H_MV53639 3212 #if !H_MV 3640 3213 , m_activeSPSId(-1) … … 3649 3222 } 3650 3223 #endif 3651 #else3652 , m_activeSPSId(-1)3653 , m_activePPSId(-1)3654 {3655 #endif3656 3224 } 3657 3225 … … 3663 3231 //! activate a SPS from a active parameter sets SEI message 3664 3232 //! \returns true, if activation is successful 3665 #if H_MV53666 3233 #if H_MV 3667 3234 Bool ParameterSetManager::activateSPSWithSEI(Int spsId, Int layerId ) … … 3669 3236 Bool ParameterSetManager::activateSPSWithSEI(Int spsId) 3670 3237 #endif 3671 #else3672 Bool ParameterSetManager::activateSPSWithSEI(Int spsId)3673 #endif3674 3238 { 3675 3239 TComSPS *sps = m_spsMap.getPS(spsId); … … 3680 3244 { 3681 3245 m_activeVPSId = vpsId; 3682 #if !H_MV53683 m_activeSPSId = spsId;3684 #else3685 3246 #if H_MV 3686 3247 m_activeSPSId[ layerId ] = spsId; … … 3688 3249 m_activeSPSId = spsId; 3689 3250 #endif 3690 #endif3691 3251 return true; 3692 3252 } … … 3705 3265 //! activate a PPS and depending on isIDR parameter also SPS and VPS 3706 3266 //! \returns true, if activation is successful 3707 #if H_MV53708 3267 #if H_MV 3709 3268 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIRAP, Int layerId ) … … 3742 3301 m_activeSPSId[ layerId ] = spsId; 3743 3302 #else 3744 m_activePPSId = ppsId;3745 m_activeVPSId = vpsId;3746 m_activeSPSId = spsId;3747 #endif3748 #else3749 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIRAP)3750 {3751 TComPPS *pps = m_ppsMap.getPS(ppsId);3752 if (pps)3753 {3754 Int spsId = pps->getSPSId();3755 #if H_MV3756 // active parameter sets per layer should be used here3757 #else3758 if (!isIRAP && (spsId != m_activeSPSId))3759 {3760 printf("Warning: tried to activate PPS referring to a inactive SPS at non-IRAP.");3761 return false;3762 }3763 #endif3764 TComSPS *sps = m_spsMap.getPS(spsId);3765 if (sps)3766 {3767 Int vpsId = sps->getVPSId();3768 if (!isIRAP && (vpsId != m_activeVPSId))3769 {3770 printf("Warning: tried to activate PPS referring to a inactive VPS at non-IRAP.");3771 return false;3772 }3773 if (m_vpsMap.getPS(vpsId))3774 {3775 3303 m_activePPSId = ppsId; 3776 3304 m_activeVPSId = vpsId; … … 3828 3356 //! \} 3829 3357 3830 #if H_MV53831 3358 #if H_MV 3832 3359 TComVPSVUI::TComVPSVUI() … … 3861 3388 } 3862 3389 #endif 3863 #endif -
TabularUnified trunk/source/Lib/TLibCommon/TComSlice.h ¶
r622 r655 155 155 Void setScalingListPresentFlag (Bool b) { m_scalingListPresentFlag = b; } 156 156 Bool getScalingListPresentFlag () { return m_scalingListPresentFlag; } 157 Bool getUseTransformSkip () { return m_useTransformSkip; }158 Void setUseTransformSkip (Bool b) { m_useTransformSkip = b; }159 157 Int* getScalingListAddress (UInt sizeId, UInt listId) { return m_scalingListCoef[sizeId][listId]; } //!< get matrix coefficient 160 158 Bool checkPredMode (UInt sizeId, UInt listId); … … 169 167 Void processRefMatrix (UInt sizeId, UInt listId , UInt refListId ); 170 168 Bool xParseScalingList (Char* pchFile); 171 #if H_MV5172 169 #if H_MV 173 170 Void inferFrom ( TComScalingList* srcScLi ); 174 #endif175 171 #endif 176 172 … … 184 180 UInt m_predMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index 185 181 Int *m_scalingListCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix 186 Bool m_useTransformSkip; //!< transform skipping flag for setting default scaling matrix for 4x4187 182 }; 188 183 … … 407 402 }; 408 403 409 #if H_MV5410 404 #if H_MV 411 405 class TComVPSVUI … … 502 496 }; 503 497 #endif 504 #endif505 498 506 499 class TComVPS … … 510 503 UInt m_uiMaxTLayers; 511 504 512 #if H_MV5513 505 #if H_MV 514 506 UInt m_uiMaxLayersMinus1; 515 #else516 UInt m_uiMaxLayers;517 #endif518 507 #else 519 508 UInt m_uiMaxLayers; … … 551 540 /// VPS EXTENSION SYNTAX ELEMENTS 552 541 Bool m_avcBaseLayerFlag; 553 #if H_MV5554 542 Int m_vpsVuiOffset; 555 #endif556 543 Bool m_splittingFlag; 557 #if H_MV5558 544 Bool m_scalabilityMaskFlag [MAX_NUM_SCALABILITY_TYPES]; 559 #else560 Bool m_scalabilityMask [MAX_NUM_SCALABILITY_TYPES];561 #endif562 545 Int m_dimensionIdLen [MAX_NUM_SCALABILITY_TYPES]; 563 546 Bool m_vpsNuhLayerIdPresentFlag; 564 547 Int m_layerIdInNuh [MAX_NUM_LAYER_IDS]; 565 548 Int m_dimensionId [MAX_NUM_LAYER_IDS][MAX_NUM_SCALABILITY_TYPES]; 566 #if H_MV5567 549 Int m_viewIdLenMinus1; 568 550 Int m_viewIdVal [MAX_NUM_LAYERS]; 569 #endif570 551 Bool m_directDependencyFlag [MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; 571 #if H_MV5572 552 Bool m_maxTidRefPresentFlag; 573 #endif574 553 Int m_maxTidIlRefPicPlus1 [MAX_NUM_LAYERS]; 575 #if H_MV5576 554 Bool m_allRefLayersActiveFlag; 577 #endif578 555 Int m_vpsNumberLayerSetsMinus1; 579 556 Int m_vpsNumProfileTierLevelMinus1; … … 586 563 Bool m_outputLayerFlag [MAX_VPS_OUTPUTLAYER_SETS][MAX_VPS_NUH_LAYER_ID_PLUS1]; 587 564 Int m_profileLevelTierIdx [MAX_VPS_OUTPUTLAYER_SETS ]; 588 #if H_MV5589 565 Bool m_repFormatIdxPresentFlag; 590 566 Int m_vpsNumRepFormatsMinus1; 591 567 Int m_vpsRepFormatIdx [MAX_NUM_LAYERS]; 592 568 TComRepFormat* m_repFormat [MAX_NUM_LAYERS]; 593 #endif594 569 Bool m_maxOneActiveRefLayerFlag; 595 #if H_MV5596 570 Bool m_crossLayerIrapAlignedFlag; 597 #endif598 571 Int m_directDepTypeLenMinus2; 599 #if H_MV5600 572 Bool m_vpsVuiPresentFlag; 601 573 TComVPSVUI* m_vpsVUI; 602 #endif603 574 Int m_directDependencyType [MAX_NUM_LAYERS] [MAX_NUM_LAYERS]; 604 575 … … 616 587 Bool m_motionPredEnabledFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 617 588 Int m_motionPredRefLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 618 #if H_MV5619 589 Int m_viewIndex [MAX_NUM_LAYERS ]; 620 #else621 #if H_3D622 Int m_viewIndex [MAX_NUM_LAYERS ];623 #endif624 625 Int xCeilLog2 ( Int val );626 #endif627 590 Int xGetDimBitOffset( Int j ); 628 591 … … 653 616 Bool m_ivMvScalingFlag; 654 617 #endif 655 #if LGE_INTER_SDC_E0156618 #if H_3D_INTER_SDC 656 619 Bool m_bInterSDCFlag[MAX_NUM_LAYERS ]; 657 620 #endif … … 681 644 Void setMaxTLayers (UInt t) { m_uiMaxTLayers = t; } 682 645 683 #if H_MV5684 646 #if H_MV 685 647 UInt getMaxLayersMinus1() { return m_uiMaxLayersMinus1; }; … … 689 651 Void setMaxLayers (UInt l) { m_uiMaxLayers = l; } 690 652 #endif 691 #else692 UInt getMaxLayers () { return m_uiMaxLayers; }693 Void setMaxLayers (UInt l) { m_uiMaxLayers = l; }694 #endif695 653 696 654 Bool getTemporalNestingFlag () { return m_bTemporalIdNestingFlag; } … … 735 693 Bool getAvcBaseLayerFlag() { return m_avcBaseLayerFlag; } 736 694 737 #if H_MV5738 695 Void setVpsVuiOffset( Int val ) { m_vpsVuiOffset = val; } 739 696 Int getVpsVuiOffset( ) { return m_vpsVuiOffset; } 740 #endif741 697 742 698 Void setSplittingFlag( Bool val ) { m_splittingFlag = val; } 743 699 Bool getSplittingFlag() { return m_splittingFlag; } 744 700 745 #if H_MV5746 701 Void setScalabilityMaskFlag( UInt val ); 747 702 Void setScalabilityMaskFlag( Int scalType, Bool val ) { m_scalabilityMaskFlag[scalType] = val; } 748 703 Bool getScalabilityMaskFlag( Int scalType ) { return m_scalabilityMaskFlag[scalType]; } 749 #else750 Void setScalabilityMask( UInt val );751 752 Void setScalabilityMask( Int scalType, Bool val ) { m_scalabilityMask[scalType] = val; }753 Bool getScalabilityMask( Int scalType ) { return m_scalabilityMask[scalType]; }754 #endif755 704 Int getNumScalabilityTypes( ); 756 705 … … 769 718 Int getDimensionId( Int layerIdInVps, Int scalIdx ) { return m_dimensionId[layerIdInVps][scalIdx]; } 770 719 771 #if H_MV5772 720 Void setViewIdLenMinus1( Int val ) { m_viewIdLenMinus1 = val; } 773 721 Int getViewIdLenMinus1( ) { return m_viewIdLenMinus1; } … … 775 723 Void setViewIdVal( Int viewOrderIndex, Int val ) { m_viewIdVal[viewOrderIndex] = val; } 776 724 Int getViewIdVal( Int viewOrderIndex ) { return m_viewIdVal[viewOrderIndex]; } 777 #endif778 725 Void setDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Bool val ) { m_directDependencyFlag[depLayeridInVps][refLayeridInVps] = val; } 779 726 Bool getDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps ) { return m_directDependencyFlag[depLayeridInVps][refLayeridInVps]; } 780 727 781 #if H_MV5782 728 Void setMaxTidRefPresentFlag( Bool flag ) { m_maxTidRefPresentFlag = flag; } 783 729 Bool getMaxTidRefPresentFlag( ) { return m_maxTidRefPresentFlag; } 784 #endif785 730 Void setMaxTidIlRefPicPlus1( Int layerIdInVps, Int val ) { m_maxTidIlRefPicPlus1[ layerIdInVps ] = val; } 786 731 Int getMaxTidIlRefPicPlus1( Int layerIdInVps ) { return m_maxTidIlRefPicPlus1[ layerIdInVps ]; } 787 #if H_MV5788 732 Void setAllRefLayersActiveFlag( Bool flag ) { m_allRefLayersActiveFlag = flag; } 789 733 Bool getAllRefLayersActiveFlag( ) { return m_allRefLayersActiveFlag; } 790 #endif791 734 Void setVpsNumberLayerSetsMinus1( Int val ) { m_vpsNumberLayerSetsMinus1 = val; } 792 735 Int getVpsNumberLayerSetsMinus1( ) { return m_vpsNumberLayerSetsMinus1; } … … 819 762 Int getProfileLevelTierIdx( Int outLayerSetIdx ) { return m_profileLevelTierIdx[ outLayerSetIdx ]; } 820 763 821 #if H_MV5822 764 Void setRepFormatIdxPresentFlag( Bool flag ) { m_repFormatIdxPresentFlag = flag; } 823 765 Bool getRepFormatIdxPresentFlag( ) { return m_repFormatIdxPresentFlag; } … … 831 773 Void setRepFormat( Int i, TComRepFormat* val ) { m_repFormat[i] = val; } 832 774 TComRepFormat* getRepFormat( Int i ) { return m_repFormat[i]; } 833 #endif834 775 Void setMaxOneActiveRefLayerFlag( Bool flag) { m_maxOneActiveRefLayerFlag = flag; } 835 776 Bool getMaxOneActiveRefLayerFlag( ) { return m_maxOneActiveRefLayerFlag; } 836 #if H_MV5837 777 Void setCrossLayerIrapAlignedFlag( Bool flag ) { m_crossLayerIrapAlignedFlag = flag; } 838 778 Bool getCrossLayerIrapAlignedFlag( ) { return m_crossLayerIrapAlignedFlag; } 839 #endif840 779 Void setDirectDepTypeLenMinus2( Int val) { m_directDepTypeLenMinus2 = val; } 841 780 Int getDirectDepTypeLenMinus2( ) { return m_directDepTypeLenMinus2; } … … 843 782 Void setDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps, Int val) { m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ] = val; } 844 783 Int getDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps) { return m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ]; } 845 #if H_MV5846 784 Void setVpsVuiPresentFlag( Bool flag ) { m_vpsVuiPresentFlag = flag; } 847 785 Bool getVpsVuiPresentFlag( ) { return m_vpsVuiPresentFlag; } 848 786 849 787 TComVPSVUI* getVPSVUI( ) { return m_vpsVUI; } 850 #endif851 788 // VPS EXTENSION SEMANTICS VARIABLES 852 789 Void setLayerIdInVps( Int layerIdInNuh, Int val ) { m_layerIdInVps[layerIdInNuh] = val; } … … 854 791 855 792 Int getScalabilityId ( Int layerIdInVps, ScalabilityType scalType ); 856 #if H_MV5857 793 Int getViewId ( Int layerIdInNuh ) { return m_viewIdVal[ getViewIndex( getLayerIdInVps( layerIdInNuh) )]; } 858 #else859 Int getViewId ( Int layerIdInVps ) { return getScalabilityId( layerIdInVps, VIEW_ID ); }860 861 #endif862 794 Void setRefLayers(); 863 795 864 #if H_MV5865 796 Int getViewIndex ( Int layerIdInNuh ) { return getScalabilityId( getLayerIdInVps(layerIdInNuh), VIEW_ORDER_INDEX ); } 866 797 Int getNumViews(); … … 868 799 Int getNumDirectRefLayers( Int layerIdInNuh ) { return m_numDirectRefLayers[ layerIdInNuh ]; }; 869 800 Int getRefLayerId ( Int layerIdInNuh, Int idx );; 870 #else871 Int getNumDirectRefLayers( Int layerIdInVps ) { return m_numDirectRefLayers[ layerIdInVps ]; };872 Int getRefLayerId ( Int layerIdInVps, Int idx );;873 874 Int getNumSamplePredRefLayers( Int layerIdInVps ) { return m_numSamplePredRefLayers[layerIdInVps]; }875 Bool getSamplePredEnabledFlag ( Int layerIdInVps, Int idx ) { return m_samplePredEnabledFlag [layerIdInVps][idx]; }876 Int getSamplePredRefLayerId ( Int layerIdInVps, Int idx ) { return m_samplePredRefLayerId [layerIdInVps][idx]; }877 878 Int getNumMotionPredRefLayers( Int layerIdInVps ) { return m_numMotionPredRefLayers[layerIdInVps]; }879 Bool getMotionPredEnabledFlag ( Int layerIdInVps, Int idx ) { return m_motionPredEnabledFlag [layerIdInVps][idx]; }880 Int getMotionPredRefLayerId ( Int layerIdInVps, Int idx ) { return m_motionPredRefLayerId [layerIdInVps][idx]; }881 #endif882 801 Bool checkVPSExtensionSyntax(); 883 802 Int scalTypeToScalIdx ( ScalabilityType scalType ); 884 803 885 #if H_MV5886 804 Int getProfileLevelTierIdxLen() { return gCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); }; 887 #else888 Int getProfileLevelTierIdxLen() { return xCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); };889 #endif890 805 891 806 Int getNumLayersInIdList ( Int lsIdx );; … … 895 810 Int inferLastDimsionIdLenMinus1(); 896 811 897 #if H_MV5898 812 // helpers 899 813 Bool getInDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Int depth = 0 ); 900 #endif901 814 /// VPS EXTENSION 2 SYNTAX ELEMENTS 902 815 #if H_3D 903 #if H_MV5904 816 Int getDepthId ( Int layerIdInNuh) { return getScalabilityId( getLayerIdInVps(layerIdInNuh), DEPTH_ID ); } 905 #else906 Void initViewIndex();907 Int getViewIndex ( Int layerIdInVps ) { return m_viewIndex[ layerIdInVps ]; }908 Int getDepthId ( Int layerIdInVps ) { return getScalabilityId( layerIdInVps, DEPTH_ID ); }909 #endif910 817 Int getLayerIdInNuh( Int viewIndex, Bool depthFlag ); 911 818 … … 943 850 Bool getIvMvScalingFlag ( ) { return m_ivMvScalingFlag; } 944 851 Void setIvMvScalingFlag ( Bool b ) { m_ivMvScalingFlag = b; } 945 #if LGE_INTER_SDC_E0156852 #if H_3D_INTER_SDC 946 853 Bool getInterSDCFlag ( Int layerIdInVps ) { return m_bInterSDCFlag[layerIdInVps]; } 947 854 Void setInterSDCFlag ( Int layerIdInVps, Bool bval ){ m_bInterSDCFlag[layerIdInVps] = bval; } … … 960 867 Int m_winTopOffset; 961 868 Int m_winBottomOffset; 962 #if H_MV5963 869 #if H_MV 964 870 Bool m_scaledFlag; 965 #endif966 871 #endif 967 872 public: … … 972 877 , m_winTopOffset (0) 973 878 , m_winBottomOffset (0) 974 #if H_MV5975 879 #if H_MV 976 880 , m_scaledFlag(true) 977 #endif978 881 #endif 979 882 { } … … 990 893 Void setWindowBottomOffset(Int val) { m_winBottomOffset = val; m_enabledFlag = true; } 991 894 992 #if H_MV5993 895 #if H_MV 994 896 Void setScaledFlag(Bool flag) { m_scaledFlag = flag; } … … 1005 907 } 1006 908 } 1007 #endif1008 909 #endif 1009 910 Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom) … … 1054 955 TComHRD m_hrdParameters; 1055 956 TimingInfo m_timingInfo; 1056 #if !H_MV51057 #if H_MV1058 Bool m_tileBoundariesAlignedFlag;1059 #endif1060 #endif1061 957 1062 958 public: … … 1091 987 ,m_log2MaxMvLengthHorizontal(15) 1092 988 ,m_log2MaxMvLengthVertical(15) 1093 #if !H_MV51094 #if H_MV1095 ,m_tileBoundariesAlignedFlag(true)1096 #endif1097 #endif1098 989 {} 1099 990 … … 1191 1082 TComHRD* getHrdParameters () { return &m_hrdParameters; } 1192 1083 TimingInfo* getTimingInfo() { return &m_timingInfo; } 1193 #if !H_MV51194 #if H_MV1195 Bool getTileBoundariesAlignedFlag( ) { return m_tileBoundariesAlignedFlag; }1196 Void setTileBoundariesAlignedFlag( Bool flag ) { m_tileBoundariesAlignedFlag = flag; }1197 #endif1198 #endif1199 1084 1200 1085 }; … … 1281 1166 TComPTL m_pcPTL; 1282 1167 #if H_MV 1283 #if H_MV51284 1168 TComVPS* m_pcVPS; 1285 1169 // SPS … … 1287 1171 Int m_spsScalingListRefLayerId; 1288 1172 Bool m_updateRepFormatFlag; 1289 #endif1290 1173 // SPS Extension 1291 1174 Bool m_interViewMvVertConstraintFlag; 1292 #if !H_MV51293 Int m_numIlpRestrictedRefLayers ;1294 Int m_minSpatialSegmentOffsetPlus1[MAX_NUM_LAYERS];1295 Bool m_ctuBasedOffsetEnabledFlag [MAX_NUM_LAYERS];1296 Int m_minHorizontalCtuOffsetPlus1 [MAX_NUM_LAYERS];1297 #endif1298 1175 #endif 1299 1176 #if H_3D … … 1432 1309 TComPTL* getPTL() { return &m_pcPTL; } 1433 1310 #if H_MV 1434 #if H_MV51435 1311 Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } 1436 1312 TComVPS* getVPS () { return m_pcVPS; } … … 1444 1320 Void setUpdateRepFormatFlag( Bool flag ) { m_updateRepFormatFlag = flag; } 1445 1321 Bool getUpdateRepFormatFlag( ) { return m_updateRepFormatFlag; } 1446 #endif1447 1322 // SPS Extension 1448 1323 Void setInterViewMvVertConstraintFlag(Bool val) { m_interViewMvVertConstraintFlag = val; } 1449 1324 Bool getInterViewMvVertConstraintFlag() { return m_interViewMvVertConstraintFlag;} 1450 #if H_MV51451 1325 // Inference 1452 1326 Void inferRepFormat( TComVPS* vps, Int layerIdCurr ); 1453 1327 1454 1328 Void inferScalingList( TComSPS* spsSrc ); 1455 #else1456 Void setNumIlpRestrictedRefLayers ( Int val ) { m_numIlpRestrictedRefLayers = val;}1457 Int getNumIlpRestrictedRefLayers ( ) { return m_numIlpRestrictedRefLayers ;}1458 1459 Void setMinSpatialSegmentOffsetPlus1( Int i, Int val ) { m_minSpatialSegmentOffsetPlus1[ i ] = val;}1460 Int getMinSpatialSegmentOffsetPlus1( Int i ) { return m_minSpatialSegmentOffsetPlus1[ i ];}1461 1462 Void setCtuBasedOffsetEnabledFlag ( Int i, Bool flag ) { m_ctuBasedOffsetEnabledFlag [ i ] = flag;}1463 Bool getCtuBasedOffsetEnabledFlag ( Int i ) { return m_ctuBasedOffsetEnabledFlag [ i ];}1464 1465 Void setMinHorizontalCtuOffsetPlus1 ( Int i, Int val ) { m_minHorizontalCtuOffsetPlus1 [ i ] = val;}1466 Int getMinHorizontalCtuOffsetPlus1 ( Int i ) { return m_minHorizontalCtuOffsetPlus1 [ i ];}1467 1468 #endif1469 1329 #endif 1470 1330 #if H_3D_QTLPC … … 1582 1442 Int m_numExtraSliceHeaderBits; 1583 1443 1584 #if H_MV51585 1444 #if H_MV 1586 1445 Int m_layerId; 1587 1446 Bool m_ppsInferScalingListFlag; 1588 1447 Int m_ppsScalingListRefLayerId; 1589 #endif1590 1448 #endif 1591 1449 public: … … 1710 1568 Bool getSliceHeaderExtensionPresentFlag () { return m_sliceHeaderExtensionPresentFlag; } 1711 1569 Void setSliceHeaderExtensionPresentFlag (Bool val) { m_sliceHeaderExtensionPresentFlag = val; } 1712 #if H_MV51713 1570 #if H_MV 1714 1571 Void setLayerId( Int val ) { m_layerId = val; } … … 1720 1577 Void setPpsScalingListRefLayerId( Int val ) { m_ppsScalingListRefLayerId = val; } 1721 1578 Int getPpsScalingListRefLayerId( ) { return m_ppsScalingListRefLayerId; } 1722 #endif1723 1579 #endif 1724 1580 }; … … 1754 1610 Bool m_PicOutputFlag; ///< pic_output_flag 1755 1611 Int m_iPOC; 1756 #if H_MV51757 1612 #if H_MV 1758 1613 Int m_iPOCBeforeReset; 1759 1614 #endif 1760 #endif1761 1615 Int m_iLastIDR; 1762 static Int m_prevPOC; 1616 Int m_iAssociatedIRAP; 1617 NalUnitType m_iAssociatedIRAPType; 1618 static Int m_prevTid0POC; 1763 1619 TComReferencePictureSet *m_pcRPS; 1764 1620 TComReferencePictureSet m_LocalRPS; … … 1853 1709 Bool m_enableTMVPFlag; 1854 1710 #if H_MV 1855 #if H_MV51856 1711 std::vector<TComPic*>* m_refPicSetInterLayer0; 1857 1712 std::vector<TComPic*>* m_refPicSetInterLayer1; … … 1862 1717 Bool m_isDepth; 1863 1718 #endif 1864 #else1865 std::vector<TComPic*>* m_refPicSetInterLayer;1866 Int m_layerId;1867 Int m_viewId;1868 #if H_3D1869 Int m_viewIndex;1870 Bool m_isDepth;1871 #endif1872 #endif1873 1719 1874 1720 // Additional slice header syntax elements 1875 #if H_MV51876 1721 Bool m_pocResetFlag; 1877 #endif1878 1722 Bool m_discardableFlag; 1879 1723 Bool m_interLayerPredEnabledFlag; 1880 1724 Int m_numInterLayerRefPicsMinus1; 1881 1725 Int m_interLayerPredLayerIdc [MAX_NUM_LAYERS]; 1882 #if !H_MV51883 Bool m_interLayerSamplePredOnlyFlag;1884 Bool m_altCollocatedIndicationFlag;1885 Int m_collocatedRefLayerIdx;1886 // Additional slice header semantics variables1887 Int m_numActiveMotionPredRefLayers;1888 Int m_activeMotionPredRefLayerId [ MAX_NUM_LAYER_IDS ];1889 1890 #endif1891 1726 Int m_aaiCodedScale [2][MAX_NUM_LAYERS]; 1892 1727 Int m_aaiCodedOffset[2][MAX_NUM_LAYERS]; … … 1940 1775 Void setRPSidx ( Int iBDidx ) { m_iBDidx = iBDidx; } 1941 1776 Int getRPSidx () { return m_iBDidx; } 1942 Int getPrev POC () { return m_prevPOC; }1777 Int getPrevTid0POC () { return m_prevTid0POC; } 1943 1778 TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } 1944 1779 Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } 1945 1780 Int getLastIDR() { return m_iLastIDR; } 1781 Void setAssociatedIRAPPOC(Int iAssociatedIRAPPOC) { m_iAssociatedIRAP = iAssociatedIRAPPOC; } 1782 Int getAssociatedIRAPPOC() { return m_iAssociatedIRAP; } 1783 Void setAssociatedIRAPType(NalUnitType associatedIRAPType) { m_iAssociatedIRAPType = associatedIRAPType; } 1784 NalUnitType getAssociatedIRAPType() { return m_iAssociatedIRAPType; } 1946 1785 SliceType getSliceType () { return m_eSliceType; } 1947 1786 Int getPOC () { return m_iPOC; } … … 1988 1827 Void checkColRefIdx (UInt curSliceIdx, TComPic* pic); 1989 1828 Bool getIsUsedAsLongTerm (Int i, Int j) { return m_bIsUsedAsLongTerm[i][j]; } 1829 Void setIsUsedAsLongTerm (Int i, Int j, Bool value) { m_bIsUsedAsLongTerm[i][j] = value; } 1990 1830 Bool getCheckLDC () { return m_bCheckLDC; } 1991 1831 Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } … … 1994 1834 Void setReferenced(Bool b) { m_bRefenced = b; } 1995 1835 Bool isReferenced() { return m_bRefenced; } 1996 Void setPOC ( Int i ) { m_iPOC = i; if(getTLayer()==0) m_prevPOC=i; } 1836 Bool isReferenceNalu() { return ((getNalUnitType() <= NAL_UNIT_RESERVED_VCL_R15) && (getNalUnitType()%2 != 0)) || ((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && (getNalUnitType() <= NAL_UNIT_RESERVED_IRAP_VCL23) ); } 1837 Void setPOC ( Int i ) { m_iPOC = i; if ((getTLayer()==0) && (isReferenceNalu() && (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RASL_R)&& (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RADL_R))) {m_prevTid0POC=i;} } 1997 1838 Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } 1998 1839 NalUnitType getNalUnitType () const { return m_eNalUnitType; } … … 2000 1841 Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } 2001 1842 Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } 2002 Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic);1843 Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic); 2003 1844 Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); 2004 1845 Void setSliceType ( SliceType e ) { m_eSliceType = e; } … … 2022 1863 2023 1864 #if H_MV 2024 #if H_MV52025 1865 Void setPocBeforeReset ( Int i ) { m_iPOCBeforeReset = i; } 2026 1866 Int getPocBeforeReset ( ) { return m_iPOCBeforeReset; } 2027 #endif2028 1867 Int getRefLayerId ( RefPicList e, Int iRefIdx) { return m_aiRefLayerIdList[e][iRefIdx]; } 2029 1868 Void setRefLayerId ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefLayerIdList[e][iRefIdx] = i; } 2030 #if H_MV52031 1869 Void getTempRefPicLists ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1, 2032 1870 std::vector<TComPic*> rpsCurrList[2], std::vector<Bool> usedAsLongTerm[2], Int& numPocTotalCurr, Bool checkNumPocTotalCurr = false ); 2033 1871 2034 1872 Void setRefPicList ( std::vector<TComPic*> rpsCurrList[2], std::vector<Bool> usedAsLongTerm[2], Int numPocTotalCurr, Bool checkNumPocTotalCurr = false ); 2035 #else2036 Void setRefPicList ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& interLayerRefPicSet , Bool checkNumPocTotalCurr = false );2037 #endif2038 1873 #else 2039 1874 #if FIX1071 … … 2082 1917 Void setTLayerInfo( UInt uiTLayer ); 2083 1918 Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); 1919 Void checkLeadingPictureRestrictions( TComList<TComPic*>& rcListPic ); 2084 1920 Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); 2085 1921 #if H_MV 2086 #if !H_MV52087 Void createAndApplyIvReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer );2088 static Void markIvRefPicsAsShortTerm ( std::vector<TComPic*> refPicSetInterLayer );2089 #else2090 1922 Void createInterLayerReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1 ); 2091 1923 static Void markIvRefPicsAsShortTerm ( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 ); 2092 #endif2093 1924 static Void markCurrPic ( TComPic* currPic );; 2094 1925 static Void markIvRefPicsAsUnused ( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc ); 2095 #if H_MV52096 1926 Void printRefPicList(); 2097 #else2098 Void xPrintRefPicList();2099 #endif2100 1927 #endif 2101 1928 Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); … … 2184 2011 Void setViewId ( Int viewId ) { m_viewId = viewId; } 2185 2012 Int getViewId () { return m_viewId; } 2186 #if H_MV52187 2013 Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; } 2188 2014 Int getViewIndex () { return m_viewIndex; } 2189 #endif2190 2015 #if H_3D 2191 2016 #if H_3D_TMVP … … 2193 2018 Void setAlterRefIdx ( RefPicList e, Int i ) { m_aiAlterRefIdx[e] = i; } 2194 2019 Int getAlterRefIdx ( RefPicList e ) { return m_aiAlterRefIdx[e]; } 2195 #endif2196 #if !H_MV52197 Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; }2198 Int getViewIndex () { return m_viewIndex; }2199 2020 #endif 2200 2021 Void setIsDepth ( Bool isDepth ) { m_isDepth = isDepth; } … … 2219 2040 // Additional slice header syntax elements 2220 2041 2221 #if H_MV52222 2042 Void setPocResetFlag( Bool flag ) { m_pocResetFlag = flag; } 2223 2043 Bool getPocResetFlag( ) { return m_pocResetFlag; } 2224 #endif2225 2044 2226 2045 Void setDiscardableFlag( Bool flag ) { m_discardableFlag = flag; } … … 2236 2055 Int getInterLayerPredLayerIdc( Int i ) { return m_interLayerPredLayerIdc[i]; } 2237 2056 2238 #if H_MV52239 2057 // Additional variables derived in slice header semantics 2240 2058 Int getNumInterLayerRefPicsMinus1Len( ) { return gCeilLog2( getVPS()->getNumDirectRefLayers( getLayerId() )); } … … 2250 2068 Void setRefPicSetInterLayer ( std::vector<TComPic*>* refPicSetInterLayer0, std::vector<TComPic*>* refPicSetInterLayer1); 2251 2069 TComPic* getPicFromRefPicSetInterLayer( Int setIdc, Int layerId ); 2252 #else2253 Void setInterLayerSamplePredOnlyFlag( Bool flag ) { m_interLayerSamplePredOnlyFlag = flag; }2254 Bool getInterLayerSamplePredOnlyFlag( ) { return m_interLayerSamplePredOnlyFlag; }2255 2256 Void setAltCollocatedIndicationFlag( Bool flag ) { m_altCollocatedIndicationFlag = flag; }2257 Bool getAltCollocatedIndicationFlag( ) { return m_altCollocatedIndicationFlag; }2258 2259 Void setCollocatedRefLayerIdx( Int val ) { m_collocatedRefLayerIdx = val; }2260 Int getCollocatedRefLayerIdx( ) { return m_collocatedRefLayerIdx; }2261 2262 // Additional variables derived in slice header semantics2263 Int getNumInterLayerRefPicsMinus1Len( ) { return xCeilLog2( getVPS()->getNumDirectRefLayers( getLayerIdInVps() )); }2264 Int getInterLayerPredLayerIdcLen ( ) { return xCeilLog2( getVPS()->getNumDirectRefLayers( getLayerIdInVps() )); }2265 2266 Int getNumActiveRefLayerPics( );2267 Int getRefPicLayerId ( Int i );2268 2269 Void setActiveMotionPredRefLayers ( );2270 2271 Int getNumActiveMotionPredRefLayers( ) { return m_numActiveMotionPredRefLayers; }2272 Int getActiveMotionPredRefLayerId ( Int i ) { return m_activeMotionPredRefLayerId[i]; }2273 2274 Bool getInterRefEnabledInRPLFlag( );2275 2276 Void setRefPicSetInterLayer ( std::vector<TComPic*>* m_refPicSetInterLayer );2277 TComPic* getPicFromRefPicSetInterLayer( Int layerId );2278 2279 #endif2280 2070 #endif 2281 2071 protected: … … 2284 2074 TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb); 2285 2075 #if H_MV 2286 #if !H_MV52287 Int xCeilLog2( Int val );2288 #endif2289 2076 TComPic* xGetInterLayerRefPic( std::vector<TComPic*>& rcListIlPic, Int layerId ); 2290 2077 #endif … … 2368 2155 //! activate a SPS from a active parameter sets SEI message 2369 2156 //! \returns true, if activation is successful 2370 #if !H_MV52371 Bool activateSPSWithSEI(Int SPSId);2372 2373 //! activate a PPS and depending on isIDR parameter also SPS and VPS2374 //! \returns true, if activation is successful2375 Bool activatePPS(Int ppsId, Bool isIRAP);2376 2377 TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); };2378 TComSPS* getActiveSPS(){ return m_spsMap.getPS(m_activeSPSId); };2379 TComPPS* getActivePPS(){ return m_ppsMap.getPS(m_activePPSId); };2380 2381 protected:2382 2383 ParameterSetMap<TComVPS> m_vpsMap;2384 ParameterSetMap<TComSPS> m_spsMap;2385 ParameterSetMap<TComPPS> m_ppsMap;2386 2387 Int m_activeVPSId;2388 Int m_activeSPSId;2389 Int m_activePPSId;2390 #else2391 2157 #if H_MV 2392 2158 Bool activateSPSWithSEI(Int SPSId, Int layerId ); … … 2426 2192 #endif 2427 2193 2428 #endif2429 2194 }; 2430 2195 -
TabularUnified trunk/source/Lib/TLibCommon/TComWedgelet.cpp ¶
r622 r655 175 175 } 176 176 177 #if !SEC_DMM2_E0146_HHIFIX178 Bool TComWedgelet::checkPredDirAbovePossible( UInt uiPredDirBlockSize, UInt uiPredDirBlockOffset )179 {180 WedgeResolution eContDWedgeRes = g_dmmWedgeResolution[(UInt)g_aucConvertToBit[uiPredDirBlockSize]];181 UInt uiContDStartEndMax = 0;182 UInt uiContDStartEndOffset = 0;183 switch( eContDWedgeRes )184 {185 case( DOUBLE_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize>>1); uiContDStartEndOffset = (uiPredDirBlockOffset>>1); break; }186 case( FULL_PEL ): { uiContDStartEndMax = uiPredDirBlockSize; uiContDStartEndOffset = uiPredDirBlockOffset; break; }187 case( HALF_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize<<1); uiContDStartEndOffset = (uiPredDirBlockOffset<<1); break; }188 }189 190 if( m_uhOri == 2 || m_uhOri == 3 || m_uhOri == 4 )191 {192 UInt uiThisStartEndMax = 0;193 switch( m_eWedgeRes )194 {195 case( DOUBLE_PEL ): { uiThisStartEndMax = (m_uiWidth>>1); break; }196 case( FULL_PEL ): { uiThisStartEndMax = m_uiWidth; break; }197 case( HALF_PEL ): { uiThisStartEndMax = (m_uiWidth<<1); break; }198 }199 200 UChar uhStartX = m_uhXs;201 UChar uhStartY = m_uhYs;202 UChar uhEndX = m_uhXe;203 UChar uhEndY = m_uhYe;204 205 if( 2 == m_uhOri )206 {207 std::swap( uhStartX, uhEndX );208 std::swap( uhStartY, uhEndY );209 }210 211 UInt uiScaledEndX = (UInt)uhEndX;212 Int iDeltaRes = (Int)eContDWedgeRes - (Int)m_eWedgeRes;213 if( iDeltaRes > 0 ) { uiScaledEndX <<= iDeltaRes; }214 if( iDeltaRes < 0 ) { uiScaledEndX >>= -iDeltaRes; }215 216 if( ((UInt)uhEndY == (uiThisStartEndMax-1)) && ((uiScaledEndX-uiContDStartEndOffset) > 0 && (uiScaledEndX-uiContDStartEndOffset) < (uiContDStartEndMax-1)) )217 {218 return true;219 }220 }221 222 return false;223 }224 225 Bool TComWedgelet::checkPredDirLeftPossible( UInt uiPredDirBlockSize, UInt uiPredDirBlockOffset )226 {227 WedgeResolution eContDWedgeRes = g_dmmWedgeResolution[(UInt)g_aucConvertToBit[uiPredDirBlockSize]];228 UInt uiContDStartEndMax = 0;229 UInt uiContDStartEndOffset = 0;230 switch( eContDWedgeRes )231 {232 case( DOUBLE_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize>>1); uiContDStartEndOffset = (uiPredDirBlockOffset>>1); break; }233 case( FULL_PEL ): { uiContDStartEndMax = uiPredDirBlockSize; uiContDStartEndOffset = uiPredDirBlockOffset; break; }234 case( HALF_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize<<1); uiContDStartEndOffset = (uiPredDirBlockOffset<<1); break; }235 }236 237 if( m_uhOri == 1 || m_uhOri == 2 || m_uhOri == 5 )238 {239 UInt uiThisStartEndMax = 0;240 switch( m_eWedgeRes )241 {242 case( DOUBLE_PEL ): { uiThisStartEndMax = (m_uiHeight>>1); break; }243 case( FULL_PEL ): { uiThisStartEndMax = m_uiHeight; break; }244 case( HALF_PEL ): { uiThisStartEndMax = (m_uiHeight<<1); break; }245 }246 247 UChar uhStartX = m_uhXs;248 UChar uhStartY = m_uhYs;249 UChar uhEndX = m_uhXe;250 UChar uhEndY = m_uhYe;251 252 if( 1 == m_uhOri || 5 == m_uhOri )253 {254 std::swap( uhStartX, uhEndX );255 std::swap( uhStartY, uhEndY );256 }257 258 UInt uiScaledEndY = (UInt)uhEndY;259 Int iDeltaRes = (Int)eContDWedgeRes - (Int)m_eWedgeRes;260 if( iDeltaRes > 0 ) { uiScaledEndY <<= iDeltaRes; }261 if( iDeltaRes < 0 ) { uiScaledEndY >>= -iDeltaRes; }262 263 if( ((UInt)uhEndX == (uiThisStartEndMax-1)) && ((uiScaledEndY-uiContDStartEndOffset) > 0 && (uiScaledEndY-uiContDStartEndOffset) < (uiContDStartEndMax-1)) )264 {265 return true;266 }267 }268 269 return false;270 }271 272 Void TComWedgelet::getPredDirStartEndAbove( UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, UInt uiPredDirBlockSize, UInt uiPredDirBlockOffset, Int iDeltaEnd )273 {274 ruhXs = 0;275 ruhYs = 0;276 ruhXe = 0;277 ruhYe = 0;278 279 // get start/end of reference (=this) wedgelet280 UInt uiRefStartX = (UInt)getStartX();281 UInt uiRefStartY = (UInt)getStartY();282 UInt uiRefEndX = (UInt)getEndX();283 UInt uiRefEndY = (UInt)getEndY();284 285 WedgeResolution eContDWedgeRes = g_dmmWedgeResolution[(UInt)g_aucConvertToBit[uiPredDirBlockSize]];286 UInt uiContDStartEndMax = 0;287 UInt uiContDStartEndOffset = 0;288 switch( eContDWedgeRes )289 {290 case( DOUBLE_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize>>1); uiContDStartEndOffset = (uiPredDirBlockOffset>>1); break; }291 case( FULL_PEL ): { uiContDStartEndMax = uiPredDirBlockSize; uiContDStartEndOffset = uiPredDirBlockOffset; break; }292 case( HALF_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize<<1); uiContDStartEndOffset = (uiPredDirBlockOffset<<1); break; }293 }294 Int iContDMaxPos = (Int)uiContDStartEndMax - 1;295 296 // swap if start/end if line orientation is not from top to bottom297 if( 2 == (UInt)getOri() )298 {299 std::swap( uiRefStartX, uiRefEndX );300 std::swap( uiRefStartY, uiRefEndY );301 }302 303 // calc slopes304 Int iA_DeltaX = (Int)uiRefEndX - (Int)uiRefStartX;305 Int iA_DeltaY = (Int)uiRefEndY - (Int)uiRefStartY;306 307 // get aligned end x value of ref wedge308 UInt uiScaledRefEndX = uiRefEndX;309 Int iDeltaRes = (Int)eContDWedgeRes - (Int)m_eWedgeRes;310 if( iDeltaRes > 0 ) { uiScaledRefEndX <<= iDeltaRes; }311 if( iDeltaRes < 0 ) { uiScaledRefEndX >>= -iDeltaRes; }312 313 assert( uiScaledRefEndX >= uiContDStartEndOffset );314 Int iAlignedRefEndX = (Int)uiScaledRefEndX - (Int)uiContDStartEndOffset;315 316 // special for straight vertical wedge317 if( iA_DeltaX == 0 )318 {319 ruhXs = (UChar)iAlignedRefEndX;320 ruhYs = 0;321 322 Int iXe = iAlignedRefEndX + iDeltaEnd;323 if( iXe < 0 )324 {325 ruhXe = 0;326 ruhYe = (UChar)min( max( (iContDMaxPos + iXe), 0 ), iContDMaxPos );327 328 return;329 }330 else if( iXe > iContDMaxPos )331 {332 ruhXe = (UChar)iContDMaxPos;333 ruhYe = (UChar)min( max( (iContDMaxPos - (iXe - iContDMaxPos)), 0 ), iContDMaxPos );334 335 std::swap( ruhXs, ruhXe );336 std::swap( ruhYs, ruhYe );337 return;338 }339 else340 {341 ruhXe = (UChar)iXe;342 ruhYe = (UChar)iContDMaxPos;343 344 return;345 }346 }347 348 // special for straight horizontal short bottom line349 if( iA_DeltaY == 0 )350 {351 switch( (UInt)getOri() )352 {353 case( 2 ):354 {355 ruhXs = (UChar)(iAlignedRefEndX-1);356 ruhYs = 0;357 ruhXe = 0;358 ruhYe = (UChar)min( max( iDeltaEnd, 0 ), iContDMaxPos );359 360 return;361 }362 case( 3 ):363 {364 ruhXs = (UChar)(iAlignedRefEndX+1);365 ruhYs = 0;366 ruhXe = (UChar)iContDMaxPos;367 ruhYe = (UChar)min( max( -iDeltaEnd, 0 ), iContDMaxPos );368 369 std::swap( ruhXs, ruhXe );370 std::swap( ruhYs, ruhYe );371 return;372 }373 default:374 {375 assert( 0 );376 return;377 }378 }379 }380 381 // set start point depending on slope382 if( abs( iA_DeltaX ) >= abs( iA_DeltaY ) ) { if( iA_DeltaX < 0 ) { ruhXs = (UChar)(iAlignedRefEndX-1); ruhYs = 0; }383 if( iA_DeltaX > 0 ) { ruhXs = (UChar)(iAlignedRefEndX+1); ruhYs = 0; } }384 else { ruhXs = (UChar)(iAlignedRefEndX); ruhYs = 0; }385 386 // calc end point and determine orientation387 Int iVirtualEndX = (Int)ruhXs + roftoi( (Double)iContDMaxPos * ((Double)iA_DeltaX / (Double)iA_DeltaY) );388 389 if( iVirtualEndX < 0 )390 {391 Int iYe = roftoi( (Double)(0 - (Int)ruhXs) * ((Double)iA_DeltaY / (Double)iA_DeltaX) ) + iDeltaEnd;392 if( iYe < (Int)uiContDStartEndMax )393 {394 ruhXe = 0;395 ruhYe = (UChar)max( iYe, 0 );396 397 return;398 }399 else400 {401 ruhXe = (UChar)min( (iYe - iContDMaxPos), iContDMaxPos );402 ruhYe = (UChar)iContDMaxPos;403 404 return;405 }406 }407 else if( iVirtualEndX > iContDMaxPos )408 {409 Int iYe = roftoi( (Double)(iContDMaxPos - (Int)ruhXs) * ((Double)iA_DeltaY / (Double)iA_DeltaX) ) - iDeltaEnd;410 if( iYe < (Int)uiContDStartEndMax )411 {412 ruhXe = (UChar)iContDMaxPos;413 ruhYe = (UChar)max( iYe, 0 );414 415 std::swap( ruhXs, ruhXe );416 std::swap( ruhYs, ruhYe );417 return;418 }419 else420 {421 ruhXe = (UChar)max( (iContDMaxPos - (iYe - iContDMaxPos)), 0 );422 ruhYe = (UChar)iContDMaxPos;423 424 return;425 }426 }427 else428 {429 Int iXe = iVirtualEndX + iDeltaEnd;430 if( iXe < 0 )431 {432 ruhXe = 0;433 ruhYe = (UChar)max( (iContDMaxPos + iXe), 0 );434 435 return;436 }437 else if( iXe > iContDMaxPos )438 {439 ruhXe = (UChar)iContDMaxPos;440 ruhYe = (UChar)max( (iContDMaxPos - (iXe - iContDMaxPos)), 0 );441 442 std::swap( ruhXs, ruhXe );443 std::swap( ruhYs, ruhYe );444 return;445 }446 else447 {448 ruhXe = (UChar)iXe;449 ruhYe = (UChar)iContDMaxPos;450 451 return;452 }453 }454 }455 456 Void TComWedgelet::getPredDirStartEndLeft( UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, UInt uiPredDirBlockSize, UInt uiPredDirBlockOffset, Int iDeltaEnd )457 {458 ruhXs = 0;459 ruhYs = 0;460 ruhXe = 0;461 ruhYe = 0;462 463 // get start/end of reference (=this) wedgelet464 UInt uiRefStartX = (UInt)getStartX();465 UInt uiRefStartY = (UInt)getStartY();466 UInt uiRefEndX = (UInt)getEndX();467 UInt uiRefEndY = (UInt)getEndY();468 469 WedgeResolution eContDWedgeRes = g_dmmWedgeResolution[(UInt)g_aucConvertToBit[uiPredDirBlockSize]];470 UInt uiContDStartEndMax = 0;471 UInt uiContDStartEndOffset = 0;472 switch( eContDWedgeRes )473 {474 case( DOUBLE_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize>>1); uiContDStartEndOffset = (uiPredDirBlockOffset>>1); break; }475 case( FULL_PEL ): { uiContDStartEndMax = uiPredDirBlockSize; uiContDStartEndOffset = uiPredDirBlockOffset; break; }476 case( HALF_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize<<1); uiContDStartEndOffset = (uiPredDirBlockOffset<<1); break; }477 }478 Int iContDMaxPos = (Int)uiContDStartEndMax - 1;479 480 // swap if start/end if line orientation is not from left to right481 if( 1 == (UInt)getOri() || 5 == (UInt)getOri() )482 {483 std::swap( uiRefStartX, uiRefEndX );484 std::swap( uiRefStartY, uiRefEndY );485 }486 487 Int iL_DeltaX = (Int)uiRefEndX - (Int)uiRefStartX;488 Int iL_DeltaY = (Int)uiRefEndY - (Int)uiRefStartY;489 490 UInt uiScaledRefEndY = uiRefEndY;491 Int iDeltaRes = (Int)eContDWedgeRes - (Int)m_eWedgeRes;492 if( iDeltaRes > 0 ) { uiScaledRefEndY <<= iDeltaRes; }493 if( iDeltaRes < 0 ) { uiScaledRefEndY >>= -iDeltaRes; }494 495 assert( uiScaledRefEndY >= uiContDStartEndOffset );496 Int iAlignedRefEndY = (Int)uiScaledRefEndY - (Int)uiContDStartEndOffset;497 498 // special for straight horizontal wedge499 if( iL_DeltaY == 0 )500 {501 ruhXs = 0;502 ruhYs = (UChar)iAlignedRefEndY;503 504 Int iYe = iAlignedRefEndY - iDeltaEnd;505 if( iYe < 0 )506 {507 ruhXe = (UChar)min( max( (iContDMaxPos + iYe), 0 ), iContDMaxPos );508 ruhYe = 0;509 510 std::swap( ruhXs, ruhXe );511 std::swap( ruhYs, ruhYe );512 return;513 }514 else if( iYe > iContDMaxPos )515 {516 ruhXe = (UChar)min( max( (iContDMaxPos - (iYe - iContDMaxPos)), 0 ), iContDMaxPos );517 ruhYe = (UChar)iContDMaxPos;518 519 return;520 }521 else522 {523 ruhXe = (UChar)iContDMaxPos;524 ruhYe = (UChar)iYe;525 526 std::swap( ruhXs, ruhXe );527 std::swap( ruhYs, ruhYe );528 return;529 }530 }531 532 // special for straight vertical short right line533 if( iL_DeltaX == 0 )534 {535 switch( (UInt)getOri() )536 {537 case( 1 ):538 {539 ruhXs = 0;540 ruhYs = (UChar)(iAlignedRefEndY+1);541 ruhXe = (UChar)min( max( iDeltaEnd, 0 ), iContDMaxPos );542 ruhYe = (UChar)iContDMaxPos;543 544 return;545 }546 case( 2 ):547 {548 ruhXs = 0;549 ruhYs = (UChar)(iAlignedRefEndY-1);550 ruhXe = (UChar)min( max( -iDeltaEnd, 0 ), iContDMaxPos );551 ruhYe = 0;552 553 std::swap( ruhXs, ruhXe );554 std::swap( ruhYs, ruhYe );555 return;556 }557 default:558 {559 assert( 0 );560 return;561 }562 }563 }564 565 // set start point depending on slope566 if( abs( iL_DeltaY ) >= abs( iL_DeltaX ) ) { if( iL_DeltaY < 0 ) { ruhYs = (UChar)(iAlignedRefEndY-1); ruhXs = 0; }567 if( iL_DeltaY > 0 ) { ruhYs = (UChar)(iAlignedRefEndY+1); ruhXs = 0; } }568 else { ruhYs = (UChar)(iAlignedRefEndY); ruhXs = 0; }569 570 // calc end point and determine orientation571 Int iVirtualEndY = (Int)ruhYs + roftoi( (Double)iContDMaxPos * ((Double)iL_DeltaY / (Double)iL_DeltaX) );572 573 if( iVirtualEndY < 0 )574 {575 Int iXe = roftoi( (Double)(0 - (Int)ruhYs ) * ((Double)iL_DeltaX / (Double)iL_DeltaY) ) - iDeltaEnd;576 if( iXe < (Int)uiContDStartEndMax )577 {578 ruhXe = (UChar)max( iXe, 0 );579 ruhYe = 0;580 581 std::swap( ruhXs, ruhXe );582 std::swap( ruhYs, ruhYe );583 return;584 }585 else586 {587 ruhXe = (UChar)iContDMaxPos;588 ruhYe = (UChar)min( (iXe - iContDMaxPos), iContDMaxPos );589 590 std::swap( ruhXs, ruhXe );591 std::swap( ruhYs, ruhYe );592 return;593 }594 }595 else if( iVirtualEndY > iContDMaxPos )596 {597 Int iXe = roftoi( (Double)(iContDMaxPos - (Int)ruhYs ) * ((Double)iL_DeltaX / (Double)iL_DeltaY) ) + iDeltaEnd;598 if( iXe < (Int)uiContDStartEndMax )599 {600 ruhXe = (UChar)max( iXe, 0 );601 ruhYe = (UChar)iContDMaxPos;602 603 return;604 }605 else606 {607 ruhXe = (UChar)iContDMaxPos;608 ruhYe = (UChar)max( (iContDMaxPos - (iXe - iContDMaxPos)), 0 );609 610 std::swap( ruhXs, ruhXe );611 std::swap( ruhYs, ruhYe );612 return;613 }614 }615 else616 {617 Int iYe = iVirtualEndY - iDeltaEnd;618 if( iYe < 0 )619 {620 ruhXe = (UChar)max( (iContDMaxPos + iYe), 0 );621 ruhYe = 0;622 623 std::swap( ruhXs, ruhXe );624 std::swap( ruhYs, ruhYe );625 return;626 }627 else if( iYe > iContDMaxPos )628 {629 ruhXe = (UChar)max( (iContDMaxPos - (iYe - iContDMaxPos)), 0 );630 ruhYe = (UChar)iContDMaxPos;631 632 return;633 }634 else635 {636 ruhXe = (UChar)iContDMaxPos;637 ruhYe = (UChar)iYe;638 639 std::swap( ruhXs, ruhXe );640 std::swap( ruhYs, ruhYe );641 return;642 }643 }644 }645 #endif646 647 177 Void TComWedgelet::xGenerateWedgePattern() 648 178 { -
TabularUnified trunk/source/Lib/TLibCommon/TComWedgelet.h ¶
r622 r655 50 50 enum DIM_IDX 51 51 { 52 #if SEC_DMM2_E0146_HHIFIX53 52 DMM1_IDX = 0, 54 53 DMM3_IDX = 1, 55 54 DMM4_IDX = 2, 56 55 RBC_IDX = 3 57 #else58 DMM1_IDX = 0,59 DMM2_IDX = 3,60 DMM3_IDX = 1,61 DMM4_IDX = 2,62 RBC_IDX = 463 #endif64 56 }; 65 #if SEC_DMM2_E0146_HHIFIX 57 66 58 #define DMM_NUM_TYPE 3 67 #else68 #define DMM_NUM_TYPE 469 #endif70 59 #define RBC_NUM_TYPE 1 71 60 #define DIM_NUM_TYPE (DMM_NUM_TYPE+RBC_NUM_TYPE) … … 86 75 #define DMM_NO_WEDGEINDEX MAX_UINT 87 76 #define DMM_NUM_WEDGE_REFINES 8 88 #if !SEC_DMM2_E0146_HHIFIX89 #define DMM2_DELTAEND_MAX 490 #endif91 77 #define DMM3_SIMPLIFY_TR 1 92 78 … … 151 137 Bool checkInvIdentical( Bool* pbRefPattern ); 152 138 153 #if !SEC_DMM2_E0146_HHIFIX154 // functions for DMM2 prediction155 Bool checkPredDirAbovePossible( UInt uiPredDirBlockSize, UInt uiPredDirBlockOffsett );156 Bool checkPredDirLeftPossible ( UInt uiPredDirBlockSize, UInt uiPredDirBlockOffsett );157 Void getPredDirStartEndAbove( UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, UInt uiPredDirBlockSize, UInt uiPredDirBlockOffset, Int iDeltaEnd );158 Void getPredDirStartEndLeft ( UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, UInt uiPredDirBlockSize, UInt uiPredDirBlockOffset, Int iDeltaEnd );159 #endif160 139 }; // END CLASS DEFINITION TComWedgelet 161 140 -
TabularUnified trunk/source/Lib/TLibCommon/TComWeightPrediction.h ¶
r608 r655 53 53 class TComWeightPrediction 54 54 { 55 wpScalingParam m_wp0[3], m_wp1[3];56 57 55 public: 58 56 TComWeightPrediction(); -
TabularUnified trunk/source/Lib/TLibCommon/TypeDef.h ¶
r622 r655 92 92 // QC_CU_NBDV_D0181 93 93 // SEC_DEFAULT_DV_D0112 94 // MTK_DVMCP_FIX_E0172 1 // fix the mismatch between software and WD for DV derivation from DVMCP blocks, issue 2 in JCT3V-E0172 94 // MTK_DVMCP_FIX_E0172 fix the mismatch between software and WD for DV derivation from DVMCP blocks, issue 2 in JCT3V-E0172 95 // SEC_SIMPLIFIED_NBDV_E0142 Simplified NBDV, JCT3V-E0142 and JCT3V-E0190 96 // MTK_NBDV_TN_FIX_E0172 fix the issue of DV derivation from the temporal neighboring blocks, issue 7 in JCT3V-E0172 97 // MTK_TEXTURE_MRGCAND_BUGFIX_E0182 Bug fix for TEXTURE MERGING CANDIDATE , JCT3V-E0182 95 98 #define H_3D_ARP 1 // Advanced residual prediction (ARP), JCT3V-D0177 96 99 #define H_3D_IC 1 // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060 97 100 // Unifying rounding offset, for IC part, JCT3V-D0135 98 101 // Full Pel Interpolation for Depth, HHI_FULL_PEL_DEPTH_MAP_MV_ACC 102 // SHARP_ILLUCOMP_REFINE_E0046 103 // MTK_CLIPPING_ALIGN_IC_E0168 // To support simplify bi-prediction PU with identical motion checking, JCT3V-E0168 99 104 100 105 #if H_3D_NBDV … … 103 108 // MERL_D0166: Reference view selection in NBDV & Bi-VSP 104 109 // MERL_C0152: Basic VSP 110 // NBDV_DEFAULT_VIEWIDX_BUGFIX Bug fix for invalid default view index for NBDV 111 // NTT_DoNBDV_VECTOR_CLIP_E0141 disparity vector clipping in DoNBDV, JCT3V-E0141 and JCT3V-E0209 112 105 113 #endif 106 114 … … 112 120 // LG_D0092: Multiple VSP candidate allowed 113 121 // MTK_VSP_FIX_ALIGN_WD_E0172 122 // NTT_VSP_ADAPTIVE_SPLIT_E0207 adaptive sub-PU partitioning in VSP, JCT3V-E0207 123 // NTT_VSP_DC_BUGFIX_E0208 bugfix for sub-PU based DC in VSP, JCT3V-E0208 124 // NTT_VSP_COMMON_E0207_E0208 common part of JCT3V-E0207 and JCT3V-E0208 114 125 #define H_3D_IV_MERGE 1 // Inter-view motion merge candidate 115 126 // HHI_INTER_VIEW_MOTION_PRED … … 139 150 // FIX_SDC_ENC_RD_WVSO_D0163 140 151 // MTK_SAMPLE_BASED_SDC_D0110 141 142 143 144 ///////////////////////////////////////////////////////////////////////////////////////// 145 /////////////////////////////////// HTM-8.0 INTEGRATIONS ////////////////////////////// 146 ///////////////////////////////////////////////////////////////////////////////////////// 147 148 #define SHARP_ILLUCOMP_REFINE_E0046 1 149 #define MTK_FAST_TEXTURE_ENCODING_E0173 1 // Fast merge mode decision and early CU determination for texture component of dependent view, JCT3V-E0173 150 #define MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170 1 // Progressive MV Compression, JCT3V-E0170 151 #define LGE_INTER_SDC_E0156 1 // Enable inter SDC for depth coding 152 153 #if H_3D_IC 154 #define MTK_CLIPPING_ALIGN_IC_E0168 1 // To support simplify bi-prediction PU with identical motion checking, JCT3V-E0168 155 #endif 156 157 #if H_3D_NBDV 158 #define NBDV_DEFAULT_VIEWIDX_BUGFIX 1 // Bug fix for invalid default view index for NBDV 159 #define MTK_RVS_BUGFIX_E0172 1 // Bug fix for issues caused by reference view selection, JCT3V-E0172 160 #define MTK_TEXTURE_MRGCAND_BUGFIX_E0182 1 // Bug fix for TEXTURE MERGING CANDIDATE , JCT3V-E0182 161 162 #if MTK_RVS_BUGFIX_E0172 163 #define MTK_DIVMC_FIX_E0172 1 // fix the issue of derivation of disparity inter-view merge candidate, issue 5 in JCT3V-E0172 164 #define MTK_NBDV_TN_FIX_E0172 1 // fix the issue of DV derivation from the temporal neighboring blocks, issue 7 in JCT3V-E0172 165 #endif // MTK_RVS_BUGFIX_E0172 166 167 #if H_3D_NBDV_REF 168 #define NTT_DoNBDV_VECTOR_CLIP_E0141 1 // disparity vector clipping in DoNBDV, JCT3V-E0141 and JCT3V-E0209 169 #define SEC_SIMPLIFIED_NBDV_E0142 1 // Simplified NBDV, JCT3V-E0142 and JCT3V-E0190 170 #endif 171 #endif // H_3D_NBDV 172 152 // SEC_DMM2_E0146_HHIFIX Removal of DMM2 from DMMs 153 // ZJU_DEPTH_INTRA_MODE_E0204 Simplified Binarization for depth_intra_mode 154 // KWU_SDC_SIMPLE_DC_E0117 Simplified DC calculation for SDC 155 // SCU_HS_DMM4_REMOVE_DIV_E0242 DMM4 Division Removal 156 // LGE_SDC_REMOVE_DC_E0158 Removal of DC mode from SDC 157 // LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 1 Removal of overlap between DMM3 and DMM1 158 159 #define H_3D_INTER_SDC 1 // INTER SDC, Inter simplified depth coding 160 // LGE_INTER_SDC_E0156 Enable inter SDC for depth coding 161 #define H_3D_FCO 0 // Flexible coding order for 3D 162 163 164 165 // OTHERS 166 // MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170 // Progressive MV Compression, JCT3V-E0170 167 #define H_3D_REN_MAX_DEV_OUT 0 // Output maximal possible shift deviation 168 #define H_3D_FAST_TEXTURE_ENCODING 1 // Fast merge mode decision and early CU determination for texture component of dependent view, JCT3V-E0173 169 // MTK_FAST_TEXTURE_ENCODING_E0173 173 170 #if H_3D_DIM 174 #define SEC_DMM2_E0146_HHIFIX 1 // Removal of DMM2 from DMMs 175 #define ZJU_DEPTH_INTRA_MODE_E0204 1 // Simplified Binarization for depth_intra_mode 176 #define KWU_SDC_SIMPLE_DC_E0117 1 // Simplified DC calculation for SDC 177 #define SCU_HS_DMM4_REMOVE_DIV_E0242 1 // DMM4 Division Removal 178 #define SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX 1 // Fast DMM and RBC Mode Selection 179 #endif 180 181 #if H_3D_VSP 182 #define NTT_VSP_COMMON_E0207_E0208 1 // common part of JCT3V-E0207 and JCT3V-E0208 183 #if NTT_VSP_COMMON_E0207_E0208 184 #define NTT_VSP_DC_BUGFIX_E0208 1 // bugfix for sub-PU based DC in VSP, JCT3V-E0208 185 #define NTT_VSP_VECTOR_CLIP_E0208 1 // disparity vector clipping on fetching depth map in VSP, JCT3V-E0208 186 #define NTT_VSP_ADAPTIVE_SPLIT_E0207 1 // adaptive sub-PU partitioning in VSP, JCT3V-E0207 187 #endif 188 #endif 189 190 #define H_3D_REN_MAX_DEV_OUT 0 // Output maximal possible shift deviation 191 192 /// FIXES 193 #define H_3D_FIX_BVSP 1 // DV from NBDV instead of DoNBDV should be used 194 #define H_3D_FIX_TICKET_036 1 // fix for ticket #36 195 #define H_3D_FIX_REN 1 // fix of erroneous inpainting for renderer 196 #define H_3D_FIX_REN_WARNING 1 // fix of warning related to camera parameter precision 197 198 #define H_3D_FIX_UINT_WARNING 1 // explicit in VSD 171 #define H_3D_FAST_DEPTH_INTRA 1 // Fast DMM and RBC Mode Selection 172 // SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX 173 #endif 174 175 176 // Rate Control 177 #define KWU_FIX_URQ 1 178 #define KWU_RC_VIEWRC_E0227 0 ///< JCT3V-E0227, view-wise target bitrate allocation 179 #define KWU_RC_MADPRED_E0227 0 ///< JCT3V-E0227, inter-view MAD prediction 180 199 181 #endif // H_3D 200 182 201 183 202 ///////////////////////////////////////////////////////////////////////////////////////// 203 /////////////////////////////////// HTM-8.1 INTEGRATIONS ////////////////////////////// 204 ///////////////////////////////////////////////////////////////////////////////////////// 205 206 // Please put HTM-8.1 Integration defines here, when possible 207 208 209 /// FIXES 210 #if H_MV 211 #define H_MV_FIX_LID_PIC_HASH_SEI_T40 1 // Fix wrong layer_id in decoded picture hash SEI 212 #define H_MV5 1 // Update to MV-HEVC 5 HLS 213 #endif 184 214 185 ///////////////////////////////////////////////////////////////////////////////////////// 215 186 /////////////////////////////////// DERIVED DEFINES /////////////////////////////////// … … 223 194 #define H_3D_VSO_RM_ASSERTIONS 0 // Output VSO assertions 224 195 #define H_3D_VSO_SYNTH_DIST_OUT 0 // Output of synthesized view distortion instead of depth distortion in encoder output 225 226 196 #define H_3D_VSO_FIX 0 // This fix should be enabled after verification 227 228 #endif 229 //// ****** Neighbouring block-based Disparity Vector *********197 #endif 198 199 //// ****** neighbouring block-based disparity vector ********* 230 200 #if H_3D_NBDV 231 #if SEC_SIMPLIFIED_NBDV_E0142232 201 #define DVFROM_LEFT 0 233 202 #define DVFROM_ABOVE 1 234 203 #define IDV_CANDS 2 235 #else236 #define DVFROM_LEFTBELOW 0237 #define DVFROM_LEFT 1238 #define DVFROM_ABOVERIGHT 2239 #define DVFROM_ABOVE 3240 #define DVFROM_ABOVELEFT 4241 #define IDV_CANDS 5242 #endif243 204 #endif 244 205 … … 247 208 #define H_3D_ARP_WFNR 3 248 209 #endif 210 249 211 ///// ***** DEPTH INTRA MODES ********* 250 212 #if H_3D_DIM … … 256 218 // HHI_DEPTH_INTRA_SEARCH_RAU_C0160 257 219 // LG_ZEROINTRADEPTHRESI_A0087 258 #if H_3D_DIM_SDC 259 #define LGE_SDC_REMOVE_DC_E0158 1 // Removal of DC mode from SDC 260 #endif 261 #if H_3D_DIM_DMM 262 #define LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 1 // Removal of overlap between DMM3 and DMM1 263 #endif 264 #endif 265 220 #endif 266 221 ///// ***** VIEW SYNTHESIS PREDICTION ********* 267 222 #if H_3D_VSP … … 273 228 #endif 274 229 230 #endif 231 232 ///// ***** ILLUMATION COMPENSATION ********* 233 #if H_3D_IC 234 #define IC_REG_COST_SHIFT 7 235 #define IC_CONST_SHIFT 5 236 #define IC_SHIFT_DIFF 12 237 #endif 238 239 ///// ***** FCO ********* 240 #if H_3D_FCO 241 #define H_3D_FCO_VSP_DONBDV_E0163 1 // Adaptive depth reference for flexible coding order 242 #else 243 #define H_3D_FCO_VSP_DONBDV_E0163 0 // Adaptive depth reference for flexible coding order 275 244 #endif 276 245 … … 300 269 #define TICKET_1090_FIX 1 301 270 271 #if KWU_FIX_URQ 272 #if RATE_CONTROL_LAMBDA_DOMAIN 302 273 #define RC_FIX 1 /// suggested fix for M0036 303 274 #define RATE_CONTROL_INTRA 1 ///< JCTVC-M0257, rate control for intra 275 #endif 276 #else 277 #define RC_FIX 1 /// suggested fix for M0036 278 #define RATE_CONTROL_INTRA 1 ///< JCTVC-M0257, rate control for intra 279 #endif 280 304 281 305 282 #define MAX_CPB_CNT 32 ///< Upper bound of (cpb_cnt_minus1 + 1) … … 484 461 485 462 #if H_3D_VSO_DIST_INT 486 #if H_3D_FIX_TICKET_036487 463 typedef Int64 Dist; ///< RDO distortion 488 #else489 typedef Int Dist; ///< RDO distortion490 #endif491 464 typedef Int64 Dist64; 492 465 #define RDO_DIST_MIN MIN_INT … … 793 766 enum ScalabilityType 794 767 { 795 #if H_MV5796 768 #if H_3D 797 769 DEPTH_ID = 0, 798 770 #endif 799 771 VIEW_ORDER_INDEX = 1, 800 #else801 VIEW_ID = 0,802 #if H_3D803 DEPTH_ID = 1,804 #endif805 #endif806 772 }; 807 773 #endif -
TabularUnified trunk/source/Lib/TLibDecoder/SEIread.cpp ¶
r608 r655 315 315 316 316 /* restore primary bitstream for sei_message */ 317 getBitstream()->deleteFifo(); 317 318 delete getBitstream(); 318 319 setBitstream(bs); -
TabularUnified trunk/source/Lib/TLibDecoder/SyntaxElementParser.cpp ¶
r622 r655 58 58 if (length < 10) 59 59 { 60 fprintf( g_hTrace, "%-50s u(%d) : % d\n", pSymbolName, length, rValue );60 fprintf( g_hTrace, "%-50s u(%d) : %u\n", pSymbolName, length, rValue ); 61 61 } 62 62 else 63 63 { 64 fprintf( g_hTrace, "%-50s u(%d) : % d\n", pSymbolName, length, rValue );64 fprintf( g_hTrace, "%-50s u(%d) : %u\n", pSymbolName, length, rValue ); 65 65 } 66 66 fflush ( g_hTrace ); … … 77 77 #endif 78 78 fprintf( g_hTrace, "%8lld ", g_nSymbolCounter++ ); 79 fprintf( g_hTrace, "%-50s ue(v) : % d\n", pSymbolName, rValue );79 fprintf( g_hTrace, "%-50s ue(v) : %u\n", pSymbolName, rValue ); 80 80 fflush ( g_hTrace ); 81 81 } -
TabularUnified trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp ¶
r622 r655 330 330 } 331 331 } 332 #if H_MV5333 332 #if H_MV 334 333 if ( pcPPS->getLayerId() > 0 ) … … 344 343 { 345 344 #endif 346 #endif347 345 READ_FLAG( uiCode, "pps_scaling_list_data_present_flag" ); pcPPS->setScalingListPresentFlag( uiCode ? true : false ); 348 346 if(pcPPS->getScalingListPresentFlag ()) … … 350 348 parseScalingList( pcPPS->getScalingList() ); 351 349 } 352 #if H_MV5 353 #if H_MV 354 } 355 #endif 350 #if H_MV 351 } 356 352 #endif 357 353 … … 430 426 { 431 427 Window &defDisp = pcVUI->getDefaultDisplayWindow(); 432 #if !H_MV5433 READ_UVLC( uiCode, "def_disp_win_left_offset" ); defDisp.setWindowLeftOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc()) );434 READ_UVLC( uiCode, "def_disp_win_right_offset" ); defDisp.setWindowRightOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc()) );435 READ_UVLC( uiCode, "def_disp_win_top_offset" ); defDisp.setWindowTopOffset ( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc()) );436 READ_UVLC( uiCode, "def_disp_win_bottom_offset" ); defDisp.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc()) );437 #else438 428 #if H_MV 439 429 defDisp.setScaledFlag( false ); … … 448 438 READ_UVLC( uiCode, "def_disp_win_bottom_offset" ); defDisp.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc()) ); 449 439 #endif 450 #endif451 440 } 452 441 TimingInfo *timingInfo = pcVUI->getTimingInfo(); … … 471 460 { 472 461 READ_FLAG( uiCode, "tiles_fixed_structure_flag"); pcVUI->setTilesFixedStructureFlag(uiCode); 473 #if !H_MV5474 #if H_MV475 if ( pcSPS->getLayerId() > 0 )476 {477 READ_FLAG( uiCode, "tile_boundaries_aligned_flag" ); pcVUI->setTileBoundariesAlignedFlag( uiCode == 1 );478 }479 #endif480 #endif481 462 READ_FLAG( uiCode, "motion_vectors_over_pic_boundaries_flag"); pcVUI->setMotionVectorsOverPicBoundariesFlag(uiCode); 482 463 READ_FLAG( uiCode, "restricted_ref_pic_lists_flag"); pcVUI->setRestrictedRefPicListsFlag(uiCode); … … 597 578 READ_UVLC( uiCode, "sps_seq_parameter_set_id" ); pcSPS->setSPSId( uiCode ); 598 579 assert(uiCode <= 15); 599 #if H_MV5600 580 #if H_MV 601 581 if ( pcSPS->getLayerId() > 0 ) … … 606 586 if ( pcSPS->getUpdateRepFormatFlag() ) 607 587 { 608 #endif609 588 #endif 610 589 READ_UVLC( uiCode, "chroma_format_idc" ); pcSPS->setChromaFormatIdc( uiCode ); … … 619 598 READ_UVLC ( uiCode, "pic_width_in_luma_samples" ); pcSPS->setPicWidthInLumaSamples ( uiCode ); 620 599 READ_UVLC ( uiCode, "pic_height_in_luma_samples" ); pcSPS->setPicHeightInLumaSamples( uiCode ); 621 #if H_MV5 622 #if H_MV 623 } 624 #endif 600 #if H_MV 601 } 625 602 #endif 626 603 READ_FLAG( uiCode, "conformance_window_flag"); … … 628 605 { 629 606 Window &conf = pcSPS->getConformanceWindow(); 630 #if H_MV5631 607 #if H_MV 632 608 // Needs to be scaled later, when ChromaFormatIdc is known. … … 642 618 READ_UVLC( uiCode, "conf_win_bottom_offset" ); conf.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc() ) ); 643 619 #endif 644 #else 645 READ_UVLC( uiCode, "conf_win_left_offset" ); conf.setWindowLeftOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc() ) ); 646 READ_UVLC( uiCode, "conf_win_right_offset" ); conf.setWindowRightOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc() ) ); 647 READ_UVLC( uiCode, "conf_win_top_offset" ); conf.setWindowTopOffset ( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc() ) ); 648 READ_UVLC( uiCode, "conf_win_bottom_offset" ); conf.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc() ) ); 649 #endif 650 } 651 652 #if H_MV5 620 } 621 653 622 #if H_MV 654 623 if ( pcSPS->getUpdateRepFormatFlag() ) 655 624 { 656 #endif657 625 #endif 658 626 READ_UVLC( uiCode, "bit_depth_luma_minus8" ); … … 665 633 pcSPS->setBitDepthC( uiCode + 8 ); 666 634 pcSPS->setQpBDOffsetC( (Int) (6*uiCode) ); 667 #if H_MV5 668 #if H_MV 669 } 670 #endif 635 #if H_MV 636 } 671 637 #endif 672 638 … … 692 658 pcSPS->setNumReorderPics(uiCode, i); 693 659 #if H_MV 694 #if H_MV5695 660 READ_UVLC ( uiCode, "sps_max_latency_increase_plus1[i]"); 696 #else697 READ_UVLC ( uiCode, "sps_max_latency_increase[i]");698 #endif699 661 #else 700 662 READ_UVLC ( uiCode, "sps_max_latency_increase_plus1"); … … 736 698 if(pcSPS->getScalingListFlag()) 737 699 { 738 #if H_MV5739 700 #if H_MV 740 701 if ( pcSPS->getLayerId() > 0 ) … … 750 711 { 751 712 #endif 752 #endif753 713 READ_FLAG( uiCode, "sps_scaling_list_data_present_flag" ); pcSPS->setScalingListPresentFlag ( uiCode ); 754 714 if(pcSPS->getScalingListPresentFlag ()) … … 756 716 parseScalingList( pcSPS->getScalingList() ); 757 717 } 758 #if H_MV5 759 #if H_MV 760 } 761 #endif 718 #if H_MV 719 } 762 720 #endif 763 721 } … … 814 772 if (uiCode) 815 773 { 816 #if !H_MV5817 #if !H_MV818 while ( xMoreRbspData() )819 {820 READ_FLAG( uiCode, "sps_extension_data_flag");821 }822 #else823 READ_FLAG( uiCode, "inter_view_mv_vert_constraint_flag" ); pcSPS->setInterViewMvVertConstraintFlag(uiCode == 1 ? true : false);824 //// sps_extension_vui_parameters( )825 if( pcSPS->getVuiParameters()->getBitstreamRestrictionFlag() )826 {827 READ_UVLC( uiCode, "num_ilp_restricted_ref_layers" ); pcSPS->setNumIlpRestrictedRefLayers( uiCode );828 for( Int i = 0; i < pcSPS->getNumIlpRestrictedRefLayers( ); i++ )829 {830 READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcSPS->setMinSpatialSegmentOffsetPlus1( i, uiCode );831 if( pcSPS->getMinSpatialSegmentOffsetPlus1( i ) > 0 )832 {833 READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[ i ]"); pcSPS->setCtuBasedOffsetEnabledFlag(i, uiCode == 1 );834 if( pcSPS->getCtuBasedOffsetEnabledFlag( i ) )835 {836 READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[ i ]"); pcSPS->setMinHorizontalCtuOffsetPlus1( i, uiCode );837 }838 }839 }840 }841 842 #if H_3D_QTLPC843 if( depthFlag )844 {845 READ_FLAG( uiCode, "use_qtl_flag" );846 pcSPS->setUseQTL( uiCode );847 READ_FLAG( uiCode, "use_pc_flag" );848 pcSPS->setUsePC( uiCode );849 }850 #endif851 //// sps_extension_vui_parameters( ) END852 READ_UVLC( uiCode, "sps_shvc_reserved_zero_idc" );853 READ_FLAG( uiCode, "sps_extension2_flag");854 if ( uiCode )855 {856 #if !H_3D857 while ( xMoreRbspData() )858 {859 READ_FLAG( uiCode, "sps_extension_data_flag");860 }861 #else862 863 UInt uiCamParPrecision = 0;864 Bool bCamParSlice = false;865 if ( !depthFlag )866 {867 READ_UVLC( uiCamParPrecision, "cp_precision" );868 READ_FLAG( uiCode, "cp_in_slice_header_flag" ); bCamParSlice = ( uiCode == 1 );869 if( !bCamParSlice )870 {871 for( UInt uiBaseIndex = 0; uiBaseIndex < viewIndex; uiBaseIndex++ )872 {873 Int iCode;874 READ_SVLC( iCode, "cp_scale" ); m_aaiTempScale [ uiBaseIndex ][ viewIndex ] = iCode;875 READ_SVLC( iCode, "cp_off" ); m_aaiTempOffset [ uiBaseIndex ][ viewIndex ] = iCode;876 READ_SVLC( iCode, "cp_inv_scale_plus_scale" ); m_aaiTempScale [ viewIndex ][ uiBaseIndex ] = iCode - m_aaiTempScale [ uiBaseIndex ][ viewIndex ];877 READ_SVLC( iCode, "cp_inv_off_plus_off" ); m_aaiTempOffset [ viewIndex ][ uiBaseIndex ] = iCode - m_aaiTempOffset[ uiBaseIndex ][ viewIndex ];878 }879 }880 }881 pcSPS->initCamParaSPS( viewIndex, uiCamParPrecision, bCamParSlice, m_aaiTempScale, m_aaiTempOffset );882 READ_FLAG( uiCode, "sps_extension3_flag");883 if ( uiCode )884 {885 while ( xMoreRbspData() )886 {887 READ_FLAG( uiCode, "sps_extension_data_flag");888 }889 }890 #endif // !H_3D891 }892 #endif // !H_MV893 }894 }895 #else896 774 #if H_MV 897 775 parseSPSExtension( pcSPS ); … … 918 796 } 919 797 } 920 #endif 921 #if H_MV 5798 799 #if H_MV 922 800 Void TDecCavlc::parseSPSExtension( TComSPS* pcSPS ) 923 801 { … … 972 850 READ_CODE( 2, uiCode, "vps_reserved_three_2bits" ); assert(uiCode == 3); 973 851 #if H_MV 974 #if H_MV5975 852 READ_CODE( 6, uiCode, "vps_max_layers_minus1" ); pcVPS->setMaxLayersMinus1( uiCode ); 976 #else977 READ_CODE( 6, uiCode, "vps_max_layers_minus1" ); pcVPS->setMaxLayers( uiCode + 1 );978 #endif979 853 #else 980 854 READ_CODE( 6, uiCode, "vps_reserved_zero_6bits" ); assert(uiCode == 0); … … 1061 935 if (uiCode) 1062 936 { 1063 #if !H_MV51064 #if H_MV1065 m_pcBitstream->readOutTrailingBits();1066 1067 READ_FLAG( uiCode, "avc_base_layer_flag" ); pcVPS->setAvcBaseLayerFlag( uiCode == 1 ? true : false );1068 READ_FLAG( uiCode, "splitting_flag" ); pcVPS->setSplittingFlag( uiCode == 1 ? true : false );1069 1070 for( Int sIdx = 0; sIdx < MAX_NUM_SCALABILITY_TYPES; sIdx++ )1071 {1072 READ_FLAG( uiCode, "scalability_mask[i]" ); pcVPS->setScalabilityMask( sIdx, uiCode == 1 ? true : false );1073 }1074 1075 for( Int sIdx = 0; sIdx < pcVPS->getNumScalabilityTypes( ) - ( pcVPS->getSplittingFlag() ? 1 : 0 ); sIdx++ )1076 {1077 READ_CODE( 3, uiCode, "dimension_id_len_minus1[j]" ); pcVPS->setDimensionIdLen( sIdx, uiCode + 1 );1078 }1079 1080 if ( pcVPS->getSplittingFlag() )1081 {1082 pcVPS->setDimensionIdLen( pcVPS->getNumScalabilityTypes( ) - 1, pcVPS->inferLastDimsionIdLenMinus1() );1083 }1084 1085 READ_FLAG( uiCode, "vps_nuh_layer_id_present_flag" ); pcVPS->setVpsNuhLayerIdPresentFlag( uiCode == 1 ? true : false );1086 1087 for( Int i = 0; i <= pcVPS->getMaxLayers() - 1; i++ )1088 {1089 if ( pcVPS->getVpsNuhLayerIdPresentFlag() && ( i > 0 ) )1090 {1091 READ_CODE( 6, uiCode, "layer_id_in_nuh[i]" ); pcVPS->setLayerIdInNuh( i, uiCode );1092 }1093 else1094 {1095 pcVPS->setLayerIdInNuh( i, i );;1096 }1097 1098 pcVPS->setLayerIdInVps( pcVPS->getLayerIdInNuh( i ), i );1099 1100 for( Int j = 0; j < pcVPS->getNumScalabilityTypes() ; j++ )1101 {1102 if ( !pcVPS->getSplittingFlag() )1103 {1104 READ_CODE( pcVPS->getDimensionIdLen( j ), uiCode, "dimension_id[i][j]" ); pcVPS->setDimensionId( i, j, uiCode );1105 }1106 else1107 {1108 pcVPS->setDimensionId( i, j, pcVPS->inferDimensionId( i, j) );1109 }1110 }1111 }1112 1113 1114 for( Int i = 1; i <= pcVPS->getMaxLayers() - 1; i++ )1115 {1116 for( Int j = 0; j < i; j++ )1117 {1118 READ_FLAG( uiCode, "direct_dependency_flag[i][j]" ); pcVPS->setDirectDependencyFlag( i, j, uiCode );1119 }1120 }1121 1122 for( Int i = 0; i < pcVPS->getMaxLayers() - 1; i++ )1123 {1124 READ_CODE( 3, uiCode, "max_tid_il_ref_pics_plus1[i]" ); pcVPS->setMaxTidIlRefPicPlus1( i , uiCode );1125 }1126 1127 READ_CODE( 10, uiCode, "vps_number_layer_sets_minus1" ); pcVPS->setVpsNumberLayerSetsMinus1 ( uiCode );1128 READ_CODE( 6, uiCode, "vps_num_profile_tier_level_minus1" ); pcVPS->setVpsNumProfileTierLevelMinus1( uiCode );1129 1130 for( Int i = 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ )1131 {1132 READ_FLAG( uiCode, "vps_profile_present_flag[i]" ); pcVPS->setVpsProfilePresentFlag( i, uiCode == 1 );1133 if( !pcVPS->getVpsProfilePresentFlag( i ) )1134 {1135 READ_CODE( 6, uiCode, "profile_ref_minus1[i]" ); pcVPS->setProfileRefMinus1( i, uiCode );1136 }1137 parsePTL ( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers()-1);1138 if( !pcVPS->getVpsProfilePresentFlag( i ) )1139 {1140 TComPTL temp = *pcVPS->getPTL( i );1141 *pcVPS->getPTL( i ) = *pcVPS->getPTL( pcVPS->getProfileRefMinus1( i ) + 1 );1142 pcVPS->getPTL( i )->copyLevelFrom( &temp );1143 }1144 }1145 1146 Int numOutputLayerSets = pcVPS->getVpsNumberLayerSetsMinus1( ) + 1;1147 1148 READ_FLAG( uiCode, "more_output_layer_sets_than_default_flag" ); pcVPS->setMoreOutputLayerSetsThanDefaultFlag( uiCode == 1 );1149 1150 if ( pcVPS->getMoreOutputLayerSetsThanDefaultFlag( ) )1151 {1152 READ_CODE( 10, uiCode, "num_add_output_layer_sets_minus1" ); pcVPS->setNumAddOutputLayerSetsMinus1( uiCode );1153 numOutputLayerSets += ( pcVPS->getNumAddOutputLayerSetsMinus1( ) + 1);1154 }1155 1156 if( numOutputLayerSets > 1)1157 {1158 READ_FLAG( uiCode, "default_one_target_output_layer_flag" ); pcVPS->setDefaultOneTargetOutputLayerFlag( uiCode == 1);1159 }1160 1161 for( Int i = 1; i < numOutputLayerSets; i++ )1162 {1163 if( i > pcVPS->getVpsNumberLayerSetsMinus1( ) )1164 {1165 READ_UVLC( uiCode, "output_layer_set_idx_minus1[i]" ); pcVPS->setOutputLayerSetIdxMinus1( i, uiCode );1166 for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1; j++ )1167 {1168 READ_FLAG( uiCode, "output_layer_flag" ); pcVPS->setOutputLayerFlag( i, j, uiCode == 1 );1169 }1170 }1171 if ( pcVPS->getProfileLevelTierIdxLen() > 0 )1172 {1173 READ_CODE( pcVPS->getProfileLevelTierIdxLen(), uiCode,"profile_level_tier_idx[ i ]" ); pcVPS->setProfileLevelTierIdx( i , uiCode );1174 }1175 }1176 1177 READ_FLAG( uiCode , "max_one_active_ref_layer_flag" ); pcVPS->setMaxOneActiveRefLayerFlag( uiCode == 1 );1178 READ_UVLC( uiCode, "direct_dep_type_len_minus2"); pcVPS->setDirectDepTypeLenMinus2 ( uiCode );1179 1180 for( Int i = 1; i <= pcVPS->getMaxLayers() - 1; i++ )1181 {1182 for( Int j = 0; j < i; j++ )1183 {1184 if (pcVPS->getDirectDependencyFlag( i, j) )1185 {1186 READ_CODE( pcVPS->getDirectDepTypeLenMinus2( ) + 2, uiCode, "direct_dependency_type[i][j]" ); pcVPS->setDirectDependencyType( i, j , uiCode);1187 }1188 }1189 }1190 1191 READ_FLAG ( uiCode, "vps_shvc_reserved_zero_flag" );1192 1193 #if H_3D1194 READ_FLAG( uiCode, "vps_extension2_flag" );1195 if (uiCode)1196 {1197 m_pcBitstream->readOutTrailingBits();1198 1199 for( Int i = 0; i <= pcVPS->getMaxLayers() - 1; i++ )1200 {1201 1202 #if H_3D_ARP1203 pcVPS->setUseAdvRP ( i, 0 );1204 pcVPS->setARPStepNum( i, 1 );1205 #endif1206 if ( i != 0 )1207 {1208 if( !( pcVPS->getDepthId( i ) == 1 ) )1209 {1210 #if H_3D_IV_MERGE1211 READ_FLAG( uiCode, "iv_mv_pred_flag[i]"); pcVPS->setIvMvPredFlag ( i, uiCode == 1 ? true : false );1212 #endif1213 #if H_3D_ARP1214 READ_FLAG( uiCode, "iv_res_pred_flag[i]" ); pcVPS->setUseAdvRP ( i, uiCode ); pcVPS->setARPStepNum( i, uiCode ? H_3D_ARP_WFNR : 1 );1215 1216 #endif1217 #if H_3D_NBDV_REF1218 READ_FLAG( uiCode, "depth_refinement_flag[i]"); pcVPS->setDepthRefinementFlag ( i, uiCode == 1 ? true : false );1219 #endif1220 #if H_3D_VSP1221 READ_FLAG( uiCode, "view_synthesis_pred_flag[i]"); pcVPS->setViewSynthesisPredFlag( i, uiCode == 1 ? true : false );1222 #endif1223 }1224 else1225 {1226 1227 READ_FLAG( uiCode, "vps_depth_modes_flag[i]" ); pcVPS->setVpsDepthModesFlag( i, uiCode == 1 ? true : false );1228 // READ_FLAG( uiCode, "lim_qt_pred_flag[i]"); pcVPS->setLimQtPreFlag ( i, uiCode == 1 ? true : false );1229 #if H_3D_DIM_DLT1230 if( pcVPS->getVpsDepthModesFlag( i ) )1231 {1232 READ_FLAG( uiCode, "dlt_flag[i]" ); pcVPS->setUseDLTFlag( i, uiCode == 1 ? true : false );1233 }1234 if( pcVPS->getUseDLTFlag( i ) )1235 {1236 // decode mapping1237 UInt uiNumDepthValues;1238 // parse number of values in DLT1239 READ_UVLC(uiNumDepthValues, "num_depth_values_in_dlt[i]");1240 1241 // parse actual DLT values1242 Int* aiIdx2DepthValue = (Int*) calloc(uiNumDepthValues, sizeof(Int));1243 for(Int d=0; d<uiNumDepthValues; d++)1244 {1245 READ_UVLC(uiCode, "dlt_depth_value[i][d]");1246 aiIdx2DepthValue[d] = (Int)uiCode;1247 }1248 1249 pcVPS->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues);1250 1251 // clean memory1252 free(aiIdx2DepthValue);1253 }1254 #endif1255 #if LGE_INTER_SDC_E01561256 READ_FLAG( uiCode, "depth_inter_SDC_flag" ); pcVPS->setInterSDCFlag( i, uiCode ? true : false );1257 #endif1258 }1259 }1260 }1261 READ_FLAG( uiCode, "iv_mv_scaling_flag"); pcVPS->setIvMvScalingFlag( uiCode == 1 ? true : false );1262 }1263 #endif1264 pcVPS->checkVPSExtensionSyntax();1265 1266 pcVPS->setRefLayers();1267 1268 #else1269 while ( xMoreRbspData() )1270 {1271 READ_FLAG( uiCode, "vps_extension_data_flag");1272 }1273 #endif1274 }1275 1276 #if H_3D1277 pcVPS->initViewIndex();1278 #endif1279 return;1280 }1281 #else1282 937 #if H_MV 1283 938 m_pcBitstream->readOutTrailingBits(); … … 1305 960 #endif 1306 961 } 1307 } 1308 #endif 1309 1310 #if H_MV5 962 return; 963 } 964 1311 965 #if H_MV 1312 966 Void TDecCavlc::parseVPSExtension( TComVPS* pcVPS ) … … 1640 1294 } 1641 1295 #endif 1642 #if LGE_INTER_SDC_E01561296 #if H_3D_INTER_SDC 1643 1297 READ_FLAG( uiCode, "depth_inter_SDC_flag" ); pcVPS->setInterSDCFlag( i, uiCode ? true : false ); 1644 1298 #endif … … 1648 1302 READ_FLAG( uiCode, "iv_mv_scaling_flag"); pcVPS->setIvMvScalingFlag( uiCode == 1 ? true : false ); 1649 1303 } 1650 #endif1651 1304 #endif 1652 1305 … … 1680 1333 #if H_MV 1681 1334 vps = parameterSetManager->getPrefetchedVPS(sps->getVPSId()); 1682 #if H_MV51683 1335 assert( vps != NULL ); 1684 1336 … … 1692 1344 rpcSlice->setIsDepth ( vps->getDepthId ( rpcSlice->getLayerId() ) == 1 ); 1693 1345 #endif 1694 #else1695 assert(vps!=0);1696 rpcSlice->setVPS(vps);1697 rpcSlice->setViewId ( vps->getViewId ( rpcSlice->getLayerIdInVps() ) );1698 #if H_3D1699 rpcSlice->setViewIndex( vps->getViewIndex( rpcSlice->getLayerIdInVps() ) );1700 rpcSlice->setIsDepth ( vps->getDepthId ( rpcSlice->getLayerIdInVps() ) == 1 );1701 #endif1702 #endif1703 1346 #endif 1704 1347 rpcSlice->setSPS(sps); … … 1747 1390 { 1748 1391 #if H_MV 1749 #if H_MV51750 1392 Int esb = 0; //Don't use i, otherwise will shadow something below 1751 1393 if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) … … 1762 1404 1763 1405 for (; esb < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); esb++) 1764 #else1765 if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 )1766 {1767 READ_FLAG( uiCode, "discardable_flag" ); rpcSlice->setDiscardableFlag( uiCode == 1 );1768 }1769 1770 for (Int i = 1; i < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++)1771 #endif1772 1406 #else 1773 1407 for (Int i = 0; i < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) … … 1808 1442 READ_CODE(sps->getBitsForPOC(), uiCode, "pic_order_cnt_lsb"); 1809 1443 Int iPOClsb = uiCode; 1810 Int iPrevPOC = rpcSlice->getPrev POC();1444 Int iPrevPOC = rpcSlice->getPrevTid0POC(); 1811 1445 Int iMaxPOClsb = 1<< sps->getBitsForPOC(); 1812 Int iPrevPOClsb = iPrevPOC %iMaxPOClsb;1446 Int iPrevPOClsb = iPrevPOC & (iMaxPOClsb - 1); 1813 1447 Int iPrevPOCmsb = iPrevPOC-iPrevPOClsb; 1814 1448 Int iPOCmsb; … … 1833 1467 } 1834 1468 rpcSlice->setPOC (iPOCmsb+iPOClsb); 1835 #if H_MV51836 1469 #if H_MV 1837 1470 if ( rpcSlice->getPocResetFlag() ) … … 1841 1474 1842 1475 } 1843 #endif1844 1476 #endif 1845 1477 TComReferencePictureSet* rps; … … 1941 1573 rps->setDeltaPOC(j, - rpcSlice->getPOC() + pocLsbLt); 1942 1574 rps->setCheckLTMSBPresent(j,false); 1575 1576 // reset deltaPocMSBCycleLT for first LTRP from slice header if MSB not present 1577 if( j == offset+(numOfLtrp-numLtrpInSPS)-1 ) 1578 { 1579 deltaPocMSBCycleLT = 0; 1580 } 1943 1581 } 1944 1582 prevDeltaMSB = deltaPocMSBCycleLT; … … 1970 1608 } 1971 1609 #if H_MV 1972 #if H_MV51973 1610 Int layerId = rpcSlice->getLayerId(); 1974 1611 if( rpcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumDirectRefLayers( layerId ) > 0 ) { … … 1989 1626 } 1990 1627 } 1991 #else1992 Int layerIdInVps = rpcSlice->getLayerIdInVps();1993 if( rpcSlice->getLayerId() > 0 && vps->getNumDirectRefLayers( layerIdInVps ) > 0 )1994 {1995 READ_FLAG( uiCode, "inter_layer_pred_enabled_flag" ); rpcSlice->setInterLayerPredEnabledFlag( uiCode == 1 );1996 if( rpcSlice->getInterLayerPredEnabledFlag() && vps->getNumDirectRefLayers( layerIdInVps ) > 1 )1997 {1998 if( !vps->getMaxOneActiveRefLayerFlag())1999 {2000 READ_CODE( rpcSlice->getNumInterLayerRefPicsMinus1Len( ), uiCode, "num_inter_layer_ref_pics_minus1" ); rpcSlice->setNumInterLayerRefPicsMinus1( uiCode );2001 }2002 for( Int i = 0; i < rpcSlice->getNumActiveRefLayerPics(); i++ )2003 {2004 READ_CODE( rpcSlice->getInterLayerPredLayerIdcLen( ), uiCode, "inter_layer_pred_layer_idc" ); rpcSlice->setInterLayerPredLayerIdc( i, uiCode );2005 }2006 }2007 }2008 2009 rpcSlice->setActiveMotionPredRefLayers( );2010 2011 if( vps->getNumSamplePredRefLayers( layerIdInVps ) > 0 && rpcSlice->getNumActiveRefLayerPics() > 0 )2012 {2013 READ_FLAG( uiCode, "inter_layer_sample_pred_only_flag" ); rpcSlice->setInterLayerSamplePredOnlyFlag( uiCode == 1 );2014 }2015 #endif2016 1628 #endif 2017 1629 if(sps->getUseSAO()) … … 2155 1767 if ( rpcSlice->getEnableTMVPFlag() ) 2156 1768 { 2157 #if !H_MV52158 #if H_MV2159 if( rpcSlice->getLayerId() > 0 && rpcSlice->getNumActiveMotionPredRefLayers() > 0 )2160 {2161 READ_FLAG( uiCode, "alt_collocated_indication_flag" ); rpcSlice->setAltCollocatedIndicationFlag( uiCode == 1 );2162 }2163 2164 if( rpcSlice->getAltCollocatedIndicationFlag() && rpcSlice->getNumActiveMotionPredRefLayers() > 1 )2165 {2166 READ_UVLC( uiCode, "collocated_ref_layer_idx" ); rpcSlice->setCollocatedRefLayerIdx( uiCode );2167 }2168 else2169 {2170 #endif2171 #endif2172 1769 if ( rpcSlice->getSliceType() == B_SLICE ) 2173 1770 { … … 2191 1788 rpcSlice->setColRefIdx(0); 2192 1789 } 2193 #if !H_MV52194 #if H_MV2195 }2196 #endif2197 #endif2198 1790 } 2199 1791 if ( (pps->getUseWP() && rpcSlice->getSliceType()==P_SLICE) || (pps->getWPBiPred() && rpcSlice->getSliceType()==B_SLICE) ) … … 2651 2243 } 2652 2244 #endif 2653 #if LGE_INTER_SDC_E01562245 #if H_3D_INTER_SDC 2654 2246 Void TDecCavlc::parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2655 2247 { -
TabularUnified trunk/source/Lib/TLibDecoder/TDecCAVLC.h ¶
r622 r655 76 76 Void parseQtRootCbf ( UInt uiAbsPartIdx, UInt& uiQtRootCbf ); 77 77 Void parseVPS ( TComVPS* pcVPS ); 78 #if H_MV579 78 #if H_MV 80 79 Void parseVPSExtension ( TComVPS* pcVPS ); … … 86 85 Void parseSPSExtension ( TComSPS* pcSPS ); 87 86 #endif 88 #endif89 87 #if H_3D 90 #if H_MV591 88 Void parseVPSExtension2 ( TComVPS* pcVPS ); 92 89 Void parseSPSExtension2 ( TComSPS* pcSPS, Int viewIndex, Bool depthFlag ); 93 #endif94 90 Void parseSPS ( TComSPS* pcSPS, Int viewIndex, Bool depthFlag ); 95 91 #else … … 117 113 Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 118 114 #endif 119 #if LGE_INTER_SDC_E0156115 #if H_3D_INTER_SDC 120 116 Void parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 121 117 Void parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ); -
TabularUnified trunk/source/Lib/TLibDecoder/TDecCu.cpp ¶
r622 r655 458 458 m_pcEntropyDecoder->decodeARPW ( pcCU , uiAbsPartIdx , uiDepth ); 459 459 #endif 460 #if LGE_INTER_SDC_E0156460 #if H_3D_INTER_SDC 461 461 m_pcEntropyDecoder->decodeInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth ); 462 462 #endif … … 525 525 { 526 526 case MODE_INTER: 527 #if LGE_INTER_SDC_E0156527 #if H_3D_INTER_SDC 528 528 if( m_ppcCU[uiDepth]->getInterSDCFlag( 0 ) ) 529 529 { … … 534 534 #endif 535 535 xReconInter( m_ppcCU[uiDepth], uiDepth ); 536 #if LGE_INTER_SDC_E0156536 #if H_3D_INTER_SDC 537 537 } 538 538 #endif … … 578 578 } 579 579 580 #if LGE_INTER_SDC_E0156580 #if H_3D_INTER_SDC 581 581 Void TDecCu::xReconInterSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 582 582 { … … 895 895 // get DC prediction for each segment 896 896 Pel apDCPredValues[2]; 897 #if KWU_SDC_SIMPLE_DC_E0117898 897 m_pcPrediction->analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode); 899 #else900 m_pcPrediction->analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride);901 #endif902 898 903 899 // reconstruct residual based on mask + DC residuals -
TabularUnified trunk/source/Lib/TLibDecoder/TDecCu.h ¶
r608 r655 118 118 Void xReconIntraSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 119 119 #endif 120 #if LGE_INTER_SDC_E0156120 #if H_3D_INTER_SDC 121 121 Void xReconInterSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 122 122 #endif -
TabularUnified trunk/source/Lib/TLibDecoder/TDecEntropy.cpp ¶
r622 r655 650 650 #endif 651 651 652 #if LGE_INTER_SDC_E0156652 #if H_3D_INTER_SDC 653 653 if( pcCU->getInterSDCFlag( uiAbsPartIdx ) ) 654 654 { … … 683 683 } 684 684 685 #if LGE_INTER_SDC_E0156685 #if H_3D_INTER_SDC 686 686 Void TDecEntropy::decodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 687 687 { -
TabularUnified trunk/source/Lib/TLibDecoder/TDecEntropy.h ¶
r608 r655 91 91 virtual Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 92 92 #endif 93 #if LGE_INTER_SDC_E015693 #if H_3D_INTER_SDC 94 94 virtual Void parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 95 95 virtual Void parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ) = 0; … … 170 170 Void decodeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 171 171 #endif 172 #if LGE_INTER_SDC_E0156172 #if H_3D_INTER_SDC 173 173 Void decodeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 174 174 Void decodeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); -
TabularUnified trunk/source/Lib/TLibDecoder/TDecGop.cpp ¶
r608 r655 158 158 rpcPic->setNumDdvCandPics(rpcPic->getDisCandRefPictures(iColPoc)); 159 159 } 160 #endif 161 #if MTK_NBDV_TN_FIX_E0172 160 162 161 if(pcSlice->getViewIndex() && !pcSlice->getIsDepth() && !pcSlice->isIntra()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done. 163 162 { 164 163 rpcPic->checkTemporalIVRef(); 165 164 } 166 #endif 167 #if MTK_TEXTURE_MRGCAND_BUGFIX_E0182 165 168 166 if(pcSlice->getIsDepth()) 169 167 { … … 226 224 rpcPic->destroyNonDBFilterInfo(); 227 225 } 228 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170226 #if H_3D 229 227 rpcPic->compressMotion(2); 230 228 #endif -
TabularUnified trunk/source/Lib/TLibDecoder/TDecSbac.cpp ¶
r622 r655 89 89 #if H_3D_DIM_DMM 90 90 , m_cDmm1DataSCModel ( 1, 1, NUM_DMM1_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 91 #if !SEC_DMM2_E0146_HHIFIX92 , m_cDmm2DataSCModel ( 1, 1, NUM_DMM2_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels)93 #endif94 91 , m_cDmm3DataSCModel ( 1, 1, NUM_DMM3_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 95 92 #endif … … 102 99 #endif 103 100 #endif 104 #if LGE_INTER_SDC_E0156101 #if H_3D_INTER_SDC 105 102 , m_cInterSDCFlagSCModel ( 1, 1, NUM_INTER_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 106 103 , m_cInterSDCResidualSCModel ( 1, 1, NUM_INTER_SDC_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 179 176 #if H_3D_DIM_DMM 180 177 m_cDmm1DataSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DMM1_DATA ); 181 #if !SEC_DMM2_E0146_HHIFIX182 m_cDmm2DataSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DMM2_DATA );183 #endif184 178 m_cDmm3DataSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DMM3_DATA ); 185 179 #endif … … 192 186 #endif 193 187 #endif 194 #if LGE_INTER_SDC_E0156188 #if H_3D_INTER_SDC 195 189 m_cInterSDCFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTER_SDC_FLAG ); 196 190 m_cInterSDCResidualSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL ); … … 255 249 #if H_3D_DIM_DMM 256 250 m_cDmm1DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA ); 257 #if !SEC_DMM2_E0146_HHIFIX258 m_cDmm2DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM2_DATA );259 #endif260 251 m_cDmm3DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM3_DATA ); 261 252 #endif … … 268 259 #endif 269 260 #endif 270 #if LGE_INTER_SDC_E0156261 #if H_3D_INTER_SDC 271 262 m_cInterSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG ); 272 263 m_cInterSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL ); … … 444 435 ruiTabIdx = uiIdx; 445 436 } 446 #if !SEC_DMM2_E0146_HHIFIX 447 Void TDecSbac::xParseDmm2Offset( Int& riOffset ) 448 { 449 Int iDeltaEnd = 0; 450 if( DMM2_DELTAEND_MAX > 0 ) 451 { 452 UInt uiFlag = 0; 453 m_pcTDecBinIf->decodeBin( uiFlag, m_cDmm2DataSCModel.get(0, 0, 0) ); 454 455 if( uiFlag ) 456 { 457 UInt uiAbsValMinus1; 458 UInt uiSymbol; 459 m_pcTDecBinIf->decodeBin( uiSymbol, m_cDmm2DataSCModel.get(0, 0, 0) ); uiAbsValMinus1 = uiSymbol; 460 m_pcTDecBinIf->decodeBin( uiSymbol, m_cDmm2DataSCModel.get(0, 0, 0) ); uiAbsValMinus1 |= uiSymbol << 1; 461 iDeltaEnd = uiAbsValMinus1 + 1; 462 UInt uiSign; 463 m_pcTDecBinIf->decodeBinEP( uiSign ); 464 if( uiSign ) 465 { 466 iDeltaEnd = -iDeltaEnd; 467 } 468 } 469 } 470 riOffset = iDeltaEnd; 471 } 472 #endif 437 473 438 Void TDecSbac::xParseDmm3WedgeIdx( UInt& ruiIntraIdx, Int iNumBit ) 474 439 { … … 1175 1140 pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dimType, absPartIdx, depth ); 1176 1141 } break; 1177 #if !SEC_DMM2_E0146_HHIFIX1178 case( DMM2_IDX ):1179 {1180 Int iOffset = 0;1181 xParseDmm2Offset( iOffset );1182 pcCU->setDmm2DeltaEndSubParts( iOffset, absPartIdx, depth );1183 } break;1184 #endif1185 1142 case( DMM3_IDX ): 1186 1143 { … … 1250 1207 if( puIdx == 2 ) 1251 1208 { 1252 #if !LGE_SDC_REMOVE_DC_E01581253 while( binNum < 2 && symbol )1254 #endif1255 1209 { 1256 1210 ctxDepthMode = puIdx*3 + binNum; … … 1260 1214 } 1261 1215 if( modeCode == 0 ) { dir = PLANAR_IDX; sdcFlag = 1;} 1262 #if LGE_SDC_REMOVE_DC_E01581263 1216 else if( modeCode == 1 ) { dir = 0; sdcFlag = 0;} 1264 #else1265 else if( modeCode == 2 ) { dir = 0; sdcFlag = 0;}1266 else if( modeCode == 3 ) { dir = DC_IDX; sdcFlag = 1;}1267 #endif1268 1217 } 1269 1218 else if( puIdx == 0 ) … … 1283 1232 else 1284 1233 { 1285 #if ZJU_DEPTH_INTRA_MODE_E0204 1286 UInt maxBinNum = 0; 1287 m_pcTDecBinIf->decodeBinEP(symbol); 1288 if( symbol == 1 ) 1289 { 1290 maxBinNum = 3; 1291 } 1292 else 1293 { 1294 maxBinNum = 2; 1295 symbol = 1; 1296 } 1297 while( binNum<maxBinNum && symbol ) 1298 { 1299 ctxDepthMode = puIdx*3 + ( binNum >= 2 ? 2 : binNum ); 1300 m_pcTDecBinIf->decodeBin(symbol,m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode)); 1301 modeCode = (modeCode<<1)+symbol; 1302 binNum++; 1303 } 1304 if( maxBinNum == 3 ) 1305 { 1306 if ( modeCode == 0 ) { dir = PLANAR_IDX; sdcFlag = 1;} 1307 else if ( modeCode == 2 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;} 1308 else if ( modeCode == 6 ) { dir = (2*DMM3_IDX+DIM_OFFSET); sdcFlag = 0;} 1309 else if ( modeCode == 7 ) { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 0;} 1310 } 1311 else 1312 { 1313 if ( modeCode == 0 ) { dir = 5; sdcFlag = 0;} 1314 else if ( modeCode == 2 ) { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 1;} 1315 else if ( modeCode == 3 ) { dir = (2*DMM4_IDX+DIM_OFFSET); sdcFlag = 0;} 1316 } 1317 #else 1318 ctxDepthMode = puIdx*3 ; 1319 m_pcTDecBinIf->decodeBin( symbol, m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode) ); 1320 modeCode = (modeCode<<1) + symbol; 1321 if( !symbol ) 1322 { 1323 ctxDepthMode = puIdx*3 + 1; 1324 m_pcTDecBinIf->decodeBin( symbol, m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode) ); 1325 modeCode = (modeCode<<1) + symbol; 1326 if( symbol ) 1327 { 1328 ctxDepthMode = puIdx*3 + 2; 1329 m_pcTDecBinIf->decodeBin( symbol, m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode) ); 1330 modeCode = (modeCode<<1) + symbol; 1331 } 1234 UInt maxBinNum = 0; 1235 m_pcTDecBinIf->decodeBinEP(symbol); 1236 if( symbol == 1 ) 1237 { 1238 maxBinNum = 3; 1332 1239 } 1333 1240 else 1334 1241 { 1335 ctxDepthMode = puIdx*3 + 1; 1336 m_pcTDecBinIf->decodeBin( symbol, m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode) ); 1337 modeCode = (modeCode<<1) + symbol; 1338 if( !symbol ) 1339 { 1340 ctxDepthMode = puIdx*3 + 2; 1341 m_pcTDecBinIf->decodeBin( symbol, m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode) ); 1342 modeCode = (modeCode<<1) + symbol; 1343 } 1344 else 1345 { 1346 binNum = 0; 1347 #if LGE_SDC_REMOVE_DC_E0158 1348 #if !SEC_DMM2_E0146_HHIFIX 1349 while( symbol && binNum < 2 ) 1350 #endif 1351 #else 1352 #if SEC_DMM2_E0146_HHIFIX 1353 while( symbol && binNum < 2 ) 1354 #else 1355 while( symbol && binNum < 3 ) 1356 #endif 1357 #endif 1358 { 1359 ctxDepthMode = puIdx*3 + 2; 1360 m_pcTDecBinIf->decodeBin( symbol, m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode) ); 1361 modeCode = (modeCode<<1) + symbol; 1362 binNum++; 1363 } 1364 } 1365 } 1366 if( modeCode == 0 ) { dir = PLANAR_IDX; sdcFlag = 1;} 1367 else if( modeCode == 2 ) { dir = 5; sdcFlag = 0;} 1368 else if( modeCode == 3 ) { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 1;} 1369 else if( modeCode == 4 ) { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 0;} 1370 else if( modeCode == 5 ) { dir = (2*DMM4_IDX+DIM_OFFSET); sdcFlag = 0;} 1371 else if( modeCode == 6 ) { dir = (2*DMM3_IDX+DIM_OFFSET); sdcFlag = 0;} 1372 #if LGE_SDC_REMOVE_DC_E0158 1373 #if SEC_DMM2_E0146_HHIFIX 1374 else if( modeCode == 7 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;} 1375 #else 1376 else if( modeCode == 14 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;} 1377 else if( modeCode == 15 ) { dir = (2*DMM2_IDX+DIM_OFFSET); sdcFlag = 0;} 1378 #endif 1379 #else 1380 else if( modeCode == 14 ) { dir = DC_IDX; sdcFlag = 1;} 1381 #if SEC_DMM2_E0146_HHIFIX 1382 else if( modeCode == 15 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;} 1383 #else 1384 else if( modeCode == 30 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;} 1385 else if( modeCode == 31 ) { dir = (2*DMM2_IDX+DIM_OFFSET); sdcFlag = 0;} 1386 #endif 1387 #endif 1388 #endif 1242 maxBinNum = 2; 1243 symbol = 1; 1244 } 1245 while( binNum<maxBinNum && symbol ) 1246 { 1247 ctxDepthMode = puIdx*3 + ( binNum >= 2 ? 2 : binNum ); 1248 m_pcTDecBinIf->decodeBin(symbol,m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode)); 1249 modeCode = (modeCode<<1)+symbol; 1250 binNum++; 1251 } 1252 if( maxBinNum == 3 ) 1253 { 1254 if ( modeCode == 0 ) { dir = PLANAR_IDX; sdcFlag = 1;} 1255 else if ( modeCode == 2 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;} 1256 else if ( modeCode == 6 ) { dir = (2*DMM3_IDX+DIM_OFFSET); sdcFlag = 0;} 1257 else if ( modeCode == 7 ) { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 0;} 1258 } 1259 else 1260 { 1261 if ( modeCode == 0 ) { dir = 5; sdcFlag = 0;} 1262 else if ( modeCode == 2 ) { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 1;} 1263 else if ( modeCode == 3 ) { dir = (2*DMM4_IDX+DIM_OFFSET); sdcFlag = 0;} 1264 } 1389 1265 } 1390 1266 pcCU->setLumaIntraDirSubParts( (UChar)dir, absPartIdx, depth ); … … 2338 2214 #endif 2339 2215 2340 #if LGE_INTER_SDC_E01562216 #if H_3D_INTER_SDC 2341 2217 Void TDecSbac::parseInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2342 2218 { -
TabularUnified trunk/source/Lib/TLibDecoder/TDecSbac.h ¶
r622 r655 102 102 #if H_3D_DIM_DMM 103 103 Void xParseDmm1WedgeIdx ( UInt& ruiTabIdx, Int iNumBit ); 104 #if !SEC_DMM2_E0146_HHIFIX105 Void xParseDmm2Offset ( Int& riOffset );106 #endif107 104 Void xParseDmm3WedgeIdx ( UInt& ruiIntraIdx, Int iNumBit ); 108 105 #endif … … 114 111 #endif 115 112 #endif 116 #if LGE_INTER_SDC_E0156113 #if H_3D_INTER_SDC 117 114 Void parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 118 115 Void parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ); … … 216 213 #if H_3D_DIM_DMM 217 214 ContextModel3DBuffer m_cDmm1DataSCModel; 218 #if !SEC_DMM2_E0146_HHIFIX219 ContextModel3DBuffer m_cDmm2DataSCModel;220 #endif221 215 ContextModel3DBuffer m_cDmm3DataSCModel; 222 216 #endif … … 229 223 #endif 230 224 #endif 231 #if LGE_INTER_SDC_E0156225 #if H_3D_INTER_SDC 232 226 ContextModel3DBuffer m_cInterSDCFlagSCModel; 233 227 ContextModel3DBuffer m_cInterSDCResidualSCModel; -
TabularUnified trunk/source/Lib/TLibDecoder/TDecSlice.h ¶
r608 r655 65 65 TDecEntropy* m_pcEntropyDecoder; 66 66 TDecCu* m_pcCuDecoder; 67 UInt m_uiCurrSliceIdx;68 67 69 68 TDecSbac* m_pcBufferSbacDecoders; ///< line to store temporary contexts, one per column of tiles. -
TabularUnified trunk/source/Lib/TLibDecoder/TDecTop.cpp ¶
r622 r655 347 347 #endif 348 348 #endif 349 m_associatedIRAPType = NAL_UNIT_INVALID; 349 350 m_pocCRA = 0; 350 m_prevRAPisBLA = false;351 351 m_pocRandomAccess = MAX_INT; 352 352 m_prevPOC = MAX_INT; 353 353 m_bFirstSliceInPicture = true; 354 354 m_bFirstSliceInSequence = true; 355 m_prevSliceSkipped = false; 356 m_skippedPOC = 0; 355 357 #if H_MV 356 358 m_layerId = 0; … … 436 438 Window defaultDisplayWindow = pcSlice->getSPS()->getVuiParametersPresentFlag() ? pcSlice->getSPS()->getVuiParameters()->getDefaultDisplayWindow() : Window(); 437 439 438 #if H_MV5439 440 #if H_MV 440 441 assert( conformanceWindow .getScaledFlag() ); 441 442 assert( defaultDisplayWindow.getScaledFlag() ); 442 #endif443 443 #endif 444 444 for( Int temporalLayer=0; temporalLayer < MAX_TLAYER; temporalLayer++) … … 518 518 m_cCuDecoder.destroy(); 519 519 #if H_MV 520 #if H_MV5521 520 TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 522 #else523 TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer );524 #endif525 521 TComSlice::markCurrPic( pcPic ); 526 522 TComSlice::markIvRefPicsAsUnused ( m_ivPicLists, targetDecLayerIdSet, m_parameterSetManagerDecoder.getActiveVPS(), m_layerId, poc ); … … 591 587 assert (sps != 0); 592 588 593 #if H_MV5594 589 #if H_MV 595 590 TComVPS* vps = m_parameterSetManagerDecoder.getVPS(sps->getVPSId()); … … 599 594 if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP())) 600 595 #endif 601 #else602 if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP()))603 #endif604 596 { 605 597 printf ("Parameter set activation failed!"); … … 627 619 m_apcSlicePilot->setSPS(sps); 628 620 #if H_MV 629 #if H_MV5630 621 m_apcSlicePilot->setVPS(vps); 631 622 sps->inferRepFormat ( vps , m_layerId ); 632 623 sps->inferScalingList( m_parameterSetManagerDecoder.getActiveSPS( sps->getSpsScalingListRefLayerId() ) ); 633 #else634 m_apcSlicePilot->setVPS( m_parameterSetManagerDecoder.getActiveVPS() );635 #endif636 624 #endif 637 625 pps->setSPS(sps); … … 695 683 696 684 #if H_MV 697 #if H_MV5698 685 m_apcSlicePilot->setRefPicSetInterLayer( & m_refPicSetInterLayer0, &m_refPicSetInterLayer1 ); 699 #else700 m_apcSlicePilot->setRefPicSetInterLayer( & m_refPicSetInterLayer );701 #endif702 686 m_apcSlicePilot->setLayerId( nalu.m_layerId ); 703 687 #endif 704 688 m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder); 689 690 // set POC for dependent slices in skipped pictures 691 if(m_apcSlicePilot->getDependentSliceSegmentFlag() && m_prevSliceSkipped) 692 { 693 m_apcSlicePilot->setPOC(m_skippedPOC); 694 } 695 696 m_apcSlicePilot->setAssociatedIRAPPOC(m_pocCRA); 697 m_apcSlicePilot->setAssociatedIRAPType(m_associatedIRAPType); 705 698 706 699 #if H_MV 707 700 TComVPS* vps = m_apcSlicePilot->getVPS(); 708 #if H_MV5709 701 Int layerId = nalu.m_layerId; 710 702 setViewId ( vps->getViewId ( layerId ) ); … … 714 706 m_ivPicLists->setVPS( vps ); 715 707 #endif 716 #else717 Int layerIdInVps = vps->getLayerIdInVps( nalu.m_layerId );718 setViewId ( vps->getViewId ( layerIdInVps ) );719 #if H_3D720 setViewIndex( vps->getViewIndex( layerIdInVps ) );721 setIsDepth ( vps->getDepthId ( layerIdInVps ) == 1 );722 m_ivPicLists->setVPS( vps );723 #endif724 #endif725 708 #endif 726 709 // Skip pictures due to random access 727 710 if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay)) 728 711 { 712 m_prevSliceSkipped = true; 713 m_skippedPOC = m_apcSlicePilot->getPOC(); 729 714 return false; 730 715 } … … 732 717 if (isSkipPictureForBLA(iPOCLastDisplay)) 733 718 { 719 m_prevSliceSkipped = true; 720 m_skippedPOC = m_apcSlicePilot->getPOC(); 734 721 return false; 735 722 } 723 724 // clear previous slice skipped flag 725 m_prevSliceSkipped = false; 736 726 737 727 //we should only get a different poc for a new picture (with CTU address==0) … … 763 753 #endif 764 754 // actual decoding starts here 765 #if H_MV5766 755 #if H_MV 767 756 // This part needs further testing ! … … 771 760 } 772 761 #endif 773 #endif774 762 xActivateParameterSets(); 775 763 … … 791 779 m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS()); 792 780 #if H_MV 793 #if H_MV5794 781 m_apcSlicePilot->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 795 #else796 m_apcSlicePilot->createAndApplyIvReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer );797 #endif798 782 #endif 799 783 // Get a new picture buffer 800 784 xGetNewPicBuffer (m_apcSlicePilot, pcPic); 801 785 786 Bool isField = false; 787 Bool isTff = false; 788 789 if(!m_SEIs.empty()) 790 { 791 // Check if any new Picture Timing SEI has arrived 792 SEIMessages pictureTimingSEIs = extractSeisByType (m_SEIs, SEI::PICTURE_TIMING); 793 if (pictureTimingSEIs.size()>0) 794 { 795 SEIPictureTiming* pictureTiming = (SEIPictureTiming*) *(pictureTimingSEIs.begin()); 796 isField = (pictureTiming->m_picStruct == 1) || (pictureTiming->m_picStruct == 2); 797 isTff = (pictureTiming->m_picStruct == 1); 798 } 799 } 800 801 //Set Field/Frame coding mode 802 m_pcPic->setField(isField); 803 m_pcPic->setTopField(isTff); 804 802 805 // transfer any SEI messages that have been received to the picture 803 806 pcPic->setSEIs(m_SEIs); … … 938 941 if (bNextSlice) 939 942 { 940 pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_ prevRAPisBLA, m_cListPic );943 pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_associatedIRAPType, m_cListPic ); 941 944 // Set reference list 942 945 #if H_MV 943 #if H_MV5944 946 std::vector< TComPic* > tempRefPicLists[2]; 945 947 std::vector< Bool > usedAsLongTerm [2]; … … 948 950 pcSlice->getTempRefPicLists( m_cListPic, m_refPicSetInterLayer0, m_refPicSetInterLayer1, tempRefPicLists, usedAsLongTerm, numPocTotalCurr); 949 951 pcSlice->setRefPicList ( tempRefPicLists, usedAsLongTerm, numPocTotalCurr, true ); 950 #else951 pcSlice->setRefPicList( m_cListPic, m_refPicSetInterLayer, true );952 #endif953 952 #if H_3D_ARP 954 953 pcSlice->setARPStepNum(); … … 978 977 #if H_3D 979 978 pcSlice->setIvPicLists( m_ivPicLists ); 980 #if H_3D_IV_MERGE 979 #if H_3D_IV_MERGE 980 #if H_3D_FCO 981 //assert( !getIsDepth() ); 982 #else 981 983 assert( !getIsDepth() || ( pcSlice->getTexturePic() != 0 ) ); 984 #endif 982 985 #endif 983 986 #endif … … 1037 1040 pcSlice->setScalingList ( pcSlice->getPPS()->getScalingList() ); 1038 1041 } 1039 pcSlice->getScalingList()->setUseTransformSkip(pcSlice->getPPS()->getUseTransformSkip());1040 1042 if(!pcSlice->getPPS()->getScalingListPresentFlag() && !pcSlice->getSPS()->getScalingListPresentFlag()) 1041 1043 { … … 1084 1086 TComVPS* vps = m_parameterSetManagerDecoder.getPrefetchedVPS( 0 ); 1085 1087 assert( vps != 0 ); 1086 #if H_MV51087 1088 m_cEntropyDecoder.decodeSPS( sps, vps->getViewIndex( m_layerId ), ( vps->getDepthId( m_layerId ) == 1 ) ); 1088 1089 #else 1089 Int layerIdInVPS = vps->getLayerIdInVps( m_layerId );1090 m_cEntropyDecoder.decodeSPS( sps, vps->getViewIndex( layerIdInVPS ), ( vps->getDepthId( layerIdInVPS ) == 1 ) );1091 #endif1092 #else1093 1090 m_cEntropyDecoder.decodeSPS( sps ); 1094 1091 #endif … … 1099 1096 { 1100 1097 TComPPS* pps = new TComPPS(); 1101 #if H_MV51102 1098 #if H_MV 1103 1099 pps->setLayerId( getLayerId() ); 1104 #endif1105 1100 #endif 1106 1101 m_cEntropyDecoder.decodePPS( pps ); … … 1112 1107 if(nalUnitType == NAL_UNIT_SUFFIX_SEI) 1113 1108 { 1114 #if H_MV51115 1109 #if H_MV 1116 1110 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveSPS( m_layerId ) ); … … 1118 1112 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() ); 1119 1113 #endif 1120 #else1121 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() );1122 #endif1123 1114 } 1124 1115 else 1125 1116 { 1126 #if H_MV51127 1117 #if H_MV 1128 1118 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveSPS( m_layerId ) ); … … 1130 1120 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() ); 1131 1121 #endif 1132 #else1133 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() );1134 #endif1135 1122 SEIMessages activeParamSets = getSeisByType(m_SEIs, SEI::ACTIVE_PARAMETER_SETS); 1136 1123 if (activeParamSets.size()>0) … … 1139 1126 m_parameterSetManagerDecoder.applyPrefetchedPS(); 1140 1127 assert(seiAps->activeSeqParamSetId.size()>0); 1141 #if H_MV51142 1128 #if H_MV 1143 1129 if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParamSetId[0], m_layerId )) 1144 #else1145 if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParamSetId[0] ))1146 #endif1147 1130 #else 1148 1131 if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParamSetId[0] )) … … 1221 1204 Bool TDecTop::isSkipPictureForBLA(Int& iPOCLastDisplay) 1222 1205 { 1223 if (m_prevRAPisBLA && m_apcSlicePilot->getPOC() < m_pocCRA && (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N)) 1206 if ((m_associatedIRAPType == NAL_UNIT_CODED_SLICE_BLA_N_LP || m_associatedIRAPType == NAL_UNIT_CODED_SLICE_BLA_W_LP || m_associatedIRAPType == NAL_UNIT_CODED_SLICE_BLA_W_RADL) && 1207 m_apcSlicePilot->getPOC() < m_pocCRA && (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N)) 1224 1208 { 1225 1209 iPOCLastDisplay++; … … 1306 1290 } 1307 1291 1308 #if H_MV51309 1292 Void TDecTop::xResetPocInPicBuffer() 1310 1293 { … … 1324 1307 } 1325 1308 #endif 1326 #endif1327 1309 //! \} -
TabularUnified trunk/source/Lib/TLibDecoder/TDecTop.h ¶
r622 r655 176 176 Int m_iMaxRefPicNum; 177 177 178 NalUnitType m_associatedIRAPType; ///< NAL unit type of the associated IRAP picture 178 179 Int m_pocCRA; ///< POC number of the latest CRA picture 179 Bool m_prevRAPisBLA; ///< true if the previous RAP (CRA/CRANT/BLA/BLANT/IDR) picture is a BLA/BLANT picture180 180 Int m_pocRandomAccess; ///< POC number of the random access point (the first IDR or CRA picture) 181 181 … … 211 211 Bool m_bFirstSliceInPicture; 212 212 Bool m_bFirstSliceInSequence; 213 Bool m_prevSliceSkipped; 214 Int m_skippedPOC; 215 213 216 #if H_MV 214 217 // For H_MV m_bFirstSliceInSequence indicates first slice in sequence of the particular layer … … 216 219 Int m_viewId; 217 220 TComPicLists* m_ivPicLists; 218 #if H_MV5219 221 std::vector<TComPic*> m_refPicSetInterLayer0; 220 222 std::vector<TComPic*> m_refPicSetInterLayer1; 221 #else222 std::vector<TComPic*> m_refPicSetInterLayer;223 #endif224 223 #if H_3D 225 224 Int m_viewIndex; … … 279 278 TComPic* xGetPic( Int layerId, Int poc ); 280 279 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag ); 281 #if H_MV5282 280 Void xResetPocInPicBuffer(); 283 #endif284 281 #else 285 282 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay); -
TabularUnified trunk/source/Lib/TLibEncoder/TEncAnalyze.cpp ¶
r608 r655 52 52 TEncAnalyze m_gcAnalyzeP; 53 53 TEncAnalyze m_gcAnalyzeB; 54 55 TEncAnalyze m_gcAnalyzeAll_in; 54 56 #endif 55 57 -
TabularUnified trunk/source/Lib/TLibEncoder/TEncAnalyze.h ¶
r608 r655 116 116 } 117 117 118 Void printOutInterlaced ( Char cDelim, Double bits ) 119 { 120 Double dFps = m_dFrmRate; //--CFG_KDY 121 Double dScale = dFps / 1000 / (Double)m_uiNumPic; 122 123 printf( "\tTotal Frames | " "Bitrate " "Y-PSNR " "U-PSNR " "V-PSNR \n" ); 124 //printf( "\t------------ " " ----------" " -------- " " -------- " " --------\n" ); 125 printf( "\t %8d %c" "%12.4lf " "%8.4lf " "%8.4lf " "%8.4lf\n", 126 getNumPic(), cDelim, 127 bits * dScale, 128 getPsnrY() / (Double)getNumPic(), 129 getPsnrU() / (Double)getNumPic(), 130 getPsnrV() / (Double)getNumPic() ); 131 } 132 133 Void printSummaryOutInterlaced (Int bits) 134 { 135 FILE* pFile = fopen ("summaryTotal.txt", "at"); 136 Double dFps = m_dFrmRate; //--CFG_KDY 137 Double dScale = dFps / 1000 / (Double)m_uiNumPic; 138 139 fprintf(pFile, "%f\t %f\t %f\t %f\n", bits * dScale, 140 getPsnrY() / (Double)getNumPic(), 141 getPsnrU() / (Double)getNumPic(), 142 getPsnrV() / (Double)getNumPic() ); 143 fclose(pFile); 144 } 145 146 118 147 Void printSummary(Char ch) 119 148 { … … 155 184 extern TEncAnalyze m_gcAnalyzeP; 156 185 extern TEncAnalyze m_gcAnalyzeB; 186 187 extern TEncAnalyze m_gcAnalyzeAll_in; 157 188 #endif 158 189 -
TabularUnified trunk/source/Lib/TLibEncoder/TEncCavlc.cpp ¶
r622 r655 229 229 } 230 230 } 231 #if H_MV5232 231 #if H_MV 233 232 if ( pcPPS->getLayerId() > 0 ) … … 243 242 { 244 243 #endif 245 #endif246 244 WRITE_FLAG( pcPPS->getScalingListPresentFlag() ? 1 : 0, "pps_scaling_list_data_present_flag" ); 247 245 if( pcPPS->getScalingListPresentFlag() ) … … 252 250 codeScalingList( m_pcSlice->getScalingList() ); 253 251 } 254 #if H_MV5255 252 #if H_MV 256 253 } 257 #endif258 254 #endif 259 255 WRITE_FLAG( pcPPS->getListsModificationPresentFlag(), "lists_modification_present_flag"); … … 339 335 { 340 336 WRITE_FLAG(pcVUI->getTilesFixedStructureFlag(), "tiles_fixed_structure_flag"); 341 #if !H_MV5342 #if H_MV343 if ( pcSPS->getLayerId() > 0 )344 {345 WRITE_FLAG( pcVUI->getTileBoundariesAlignedFlag( ) ? 1 : 0 , "tile_boundaries_aligned_flag" );346 }347 #endif348 #endif349 337 WRITE_FLAG(pcVUI->getMotionVectorsOverPicBoundariesFlag(), "motion_vectors_over_pic_boundaries_flag"); 350 338 WRITE_FLAG(pcVUI->getRestrictedRefPicListsFlag(), "restricted_ref_pic_lists_flag"); … … 451 439 #endif 452 440 WRITE_UVLC( pcSPS->getSPSId (), "sps_seq_parameter_set_id" ); 453 #if H_MV5454 441 #if H_MV 455 442 if ( pcSPS->getLayerId() > 0 ) … … 460 447 if ( pcSPS->getUpdateRepFormatFlag() ) 461 448 { 462 #endif463 449 #endif 464 450 WRITE_UVLC( pcSPS->getChromaFormatIdc (), "chroma_format_idc" ); … … 472 458 WRITE_UVLC( pcSPS->getPicWidthInLumaSamples (), "pic_width_in_luma_samples" ); 473 459 WRITE_UVLC( pcSPS->getPicHeightInLumaSamples(), "pic_height_in_luma_samples" ); 474 #if H_MV5475 460 #if H_MV 476 461 } 477 #endif478 462 #endif 479 463 Window conf = pcSPS->getConformanceWindow(); … … 487 471 WRITE_UVLC( conf.getWindowBottomOffset() / TComSPS::getWinUnitY(pcSPS->getChromaFormatIdc() ), "conf_win_bottom_offset" ); 488 472 } 489 #if H_MV5490 473 #if H_MV 491 474 if ( pcSPS->getUpdateRepFormatFlag() ) 492 475 { 493 476 #endif 494 #endif495 477 WRITE_UVLC( pcSPS->getBitDepthY() - 8, "bit_depth_luma_minus8" ); 496 478 WRITE_UVLC( pcSPS->getBitDepthC() - 8, "bit_depth_chroma_minus8" ); 497 #if H_MV5498 479 #if H_MV 499 480 } 500 #endif501 481 #endif 502 482 WRITE_UVLC( pcSPS->getBitsForPOC()-4, "log2_max_pic_order_cnt_lsb_minus4" ); … … 525 505 if(pcSPS->getScalingListFlag()) 526 506 { 527 #if H_MV5528 507 #if H_MV 529 508 if ( pcSPS->getLayerId() > 0 ) … … 539 518 { 540 519 #endif 541 #endif542 520 WRITE_FLAG( pcSPS->getScalingListPresentFlag() ? 1 : 0, "sps_scaling_list_data_present_flag" ); 543 521 if(pcSPS->getScalingListPresentFlag()) … … 548 526 codeScalingList( m_pcSlice->getScalingList() ); 549 527 } 550 #if H_MV5551 528 #if H_MV 552 529 } 553 #endif554 530 #endif 555 531 } … … 598 574 } 599 575 600 #if !H_MV5601 #if H_MV602 WRITE_FLAG( 1, "sps_extension_flag" );603 WRITE_FLAG( pcSPS->getInterViewMvVertConstraintFlag() ? 1 : 0, "inter_view_mv_vert_constraint_flag" );604 //// sps_extension_vui_parameters( )605 if( pcSPS->getVuiParameters()->getBitstreamRestrictionFlag() )606 {607 WRITE_UVLC( pcSPS->getNumIlpRestrictedRefLayers( ), "num_ilp_restricted_ref_layers" );608 for( Int i = 0; i < pcSPS->getNumIlpRestrictedRefLayers( ); i++ )609 {610 WRITE_UVLC( pcSPS->getMinSpatialSegmentOffsetPlus1( i ), "min_spatial_segment_offset_plus1" );611 if( pcSPS->getMinSpatialSegmentOffsetPlus1( i ) > 0 )612 {613 WRITE_FLAG( pcSPS->getCtuBasedOffsetEnabledFlag( i ), "ctu_based_offset_enabled_flag[ i ]");614 if( pcSPS->getCtuBasedOffsetEnabledFlag( i ) )615 {616 WRITE_UVLC( pcSPS->getMinHorizontalCtuOffsetPlus1( i ), "min_horizontal_ctu_offset_plus1[ i ]");617 }618 }619 }620 }621 #if H_3D_QTLPC622 if( depthFlag )623 {624 WRITE_FLAG( pcSPS->getUseQTL() ? 1 : 0, "use_qtl_flag");625 WRITE_FLAG( pcSPS->getUsePC() ? 1 : 0, "use_pc_flag");626 }627 #endif628 //// sps_extension_vui_parameters( ) END629 WRITE_UVLC( 0, "sps_shvc_reserved_zero_idc" );630 #if !H_3D631 WRITE_FLAG( 0, "sps_extension2_flag" );632 #else633 WRITE_FLAG( 1, "sps_extension2_flag" );634 if (!depthFlag )635 {636 WRITE_UVLC( pcSPS->getCamParPrecision(), "cp_precision" );637 WRITE_FLAG( pcSPS->hasCamParInSliceHeader() ? 1 : 0, "cp_in_slice_header_flag" );638 if( !pcSPS->hasCamParInSliceHeader() )639 {640 for( UInt uiIndex = 0; uiIndex < viewIndex; uiIndex++ )641 {642 WRITE_SVLC( pcSPS->getCodedScale ()[ uiIndex ], "cp_scale" );643 WRITE_SVLC( pcSPS->getCodedOffset ()[ uiIndex ], "cp_off" );644 WRITE_SVLC( pcSPS->getInvCodedScale ()[ uiIndex ] + pcSPS->getCodedScale ()[ uiIndex ], "cp_inv_scale_plus_scale" );645 WRITE_SVLC( pcSPS->getInvCodedOffset()[ uiIndex ] + pcSPS->getCodedOffset()[ uiIndex ], "cp_inv_off_plus_off" );646 }647 }648 }649 650 WRITE_FLAG( 0, "sps_extension3_flag" );651 #endif652 #else653 WRITE_FLAG( 0, "sps_extension_flag" );654 #endif655 }656 #else657 576 #if !H_MV 658 577 WRITE_FLAG( 0, "sps_extension_flag" ); … … 706 625 } 707 626 #endif 708 #endif709 627 710 628 Void TEncCavlc::codeVPS( TComVPS* pcVPS ) … … 713 631 WRITE_CODE( 3, 2, "vps_reserved_three_2bits" ); 714 632 #if H_MV 715 #if H_MV5716 633 WRITE_CODE( pcVPS->getMaxLayersMinus1(), 6, "vps_max_layers_minus1" ); 717 #else718 WRITE_CODE( pcVPS->getMaxLayers() - 1, 6, "vps_max_layers_minus1" );719 #endif720 634 #else 721 635 WRITE_CODE( 0, 6, "vps_reserved_zero_6bits" ); … … 800 714 } 801 715 } 802 #if !H_MV5803 #if H_MV804 WRITE_FLAG( 1, "vps_extension_flag" );805 806 m_pcBitIf->writeAlignOne();807 808 WRITE_FLAG( pcVPS->getAvcBaseLayerFlag() ? 1 : 0, "avc_base_layer_flag" );809 WRITE_FLAG( pcVPS->getSplittingFlag() ? 1 : 0, "splitting_flag" );810 811 for( Int type = 0; type < MAX_NUM_SCALABILITY_TYPES; type++ )812 {813 WRITE_FLAG( pcVPS->getScalabilityMask( type ) ? 1 : 0, "scalability_mask[i]" );814 }815 816 for( Int sIdx = 0; sIdx < pcVPS->getNumScalabilityTypes( ) - ( pcVPS->getSplittingFlag() ? 1 : 0 ); sIdx++ )817 {818 WRITE_CODE( pcVPS->getDimensionIdLen( sIdx ) - 1 , 3, "dimension_id_len_minus1[j]");819 }820 821 if ( pcVPS->getSplittingFlag() )822 { // Ignore old dimension id length823 pcVPS->setDimensionIdLen( pcVPS->getNumScalabilityTypes( ) - 1 ,pcVPS->inferLastDimsionIdLenMinus1() + 1 );824 }825 826 827 WRITE_FLAG( pcVPS->getVpsNuhLayerIdPresentFlag() ? 1 : 0, "vps_nuh_layer_id_present_flag");828 829 for( Int i = 0; i <= pcVPS->getMaxLayers() - 1; i++ )830 {831 if ( pcVPS->getVpsNuhLayerIdPresentFlag() && ( i > 0 ) )832 {833 WRITE_CODE( pcVPS->getLayerIdInNuh( i ), 6, "layer_id_in_nuh[i]");834 }835 else836 {837 assert( pcVPS->getLayerIdInNuh( i ) == i );838 }839 840 assert( pcVPS->getLayerIdInVps( pcVPS->getLayerIdInNuh( i ) ) == i );841 842 for( Int j = 0; j < pcVPS->getNumScalabilityTypes() ; j++ )843 {844 if ( !pcVPS->getSplittingFlag() )845 {846 WRITE_CODE( pcVPS->getDimensionId( i, j ), pcVPS->getDimensionIdLen( j ), "dimension_id[i][j]");847 }848 else849 {850 assert( pcVPS->getDimensionId( i, j ) == pcVPS->inferDimensionId( i, j ) );851 }852 }853 }854 855 for( Int i = 1; i <= pcVPS->getMaxLayers() - 1; i++ )856 {857 for( Int j = 0; j < i; j++ )858 {859 WRITE_FLAG( pcVPS->getDirectDependencyFlag( i, j ), "direct_dependency_flag[i][j]" );860 }861 }862 863 for( Int i = 0; i < pcVPS->getMaxLayers() - 1; i++ )864 {865 WRITE_CODE( pcVPS->getMaxTidIlRefPicPlus1( i ), 3, "max_tid_il_ref_pics_plus1[i]" );866 }867 868 WRITE_CODE( pcVPS->getVpsNumberLayerSetsMinus1( ) , 10, "vps_number_layer_sets_minus1" );869 WRITE_CODE( pcVPS->getVpsNumProfileTierLevelMinus1( ), 6, "vps_num_profile_tier_level_minus1" );870 871 for( Int i = 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ )872 {873 WRITE_FLAG( pcVPS->getVpsProfilePresentFlag( i ) ? 1 : 0, "vps_profile_present_flag[i]" );874 if( !pcVPS->getVpsProfilePresentFlag( i ) )875 {876 WRITE_CODE( pcVPS->getProfileRefMinus1( i ), 6, "profile_ref_minus1[i]" );877 }878 codePTL( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers() - 1 );879 }880 881 Int numOutputLayerSets = pcVPS->getVpsNumberLayerSetsMinus1( ) + 1;882 883 WRITE_FLAG( pcVPS->getMoreOutputLayerSetsThanDefaultFlag( ) ? 1 : 0, "more_output_layer_sets_than_default_flag" );884 885 if ( pcVPS->getMoreOutputLayerSetsThanDefaultFlag( ) )886 {887 WRITE_CODE( pcVPS->getNumAddOutputLayerSetsMinus1( ) , 10, "num_add_output_layer_sets_minus1" );888 numOutputLayerSets += ( pcVPS->getNumAddOutputLayerSetsMinus1( ) + 1 );889 }890 891 if( numOutputLayerSets > 1)892 {893 WRITE_FLAG( pcVPS->getDefaultOneTargetOutputLayerFlag( ) ? 1 : 0, "default_one_target_output_layer_flag" );894 }895 896 for( Int i = 1; i < numOutputLayerSets; i++ )897 {898 if( i > pcVPS->getVpsNumberLayerSetsMinus1( ) )899 {900 WRITE_UVLC( pcVPS->getOutputLayerSetIdxMinus1( i ), "output_layer_set_idx_minus1[i]" );901 for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1 ; j++ )902 {903 WRITE_FLAG( pcVPS->getOutputLayerFlag( i, j) ? 1 : 0, "output_layer_flag" );904 }905 }906 if ( pcVPS->getProfileLevelTierIdxLen() > 0 )907 {908 WRITE_CODE( pcVPS->getProfileLevelTierIdx( i ), pcVPS->getProfileLevelTierIdxLen() ,"profile_level_tier_idx[ i ]" );909 }910 }911 912 WRITE_FLAG( pcVPS->getMaxOneActiveRefLayerFlag( ) ? 1 : 0, "max_one_active_ref_layer_flag" );913 WRITE_UVLC( pcVPS->getDirectDepTypeLenMinus2 ( ), "direct_dep_type_len_minus2");914 915 for( Int i = 1; i <= pcVPS->getMaxLayers() - 1; i++ )916 {917 for( Int j = 0; j < i; j++ )918 {919 if (pcVPS->getDirectDependencyFlag( i, j) )920 {921 assert ( pcVPS->getDirectDependencyType( i, j ) != -1 );922 WRITE_CODE( pcVPS->getDirectDependencyType( i, j ),pcVPS->getDirectDepTypeLenMinus2( ) + 2, "direct_dependency_type[i][j]" );923 }924 }925 }926 927 WRITE_FLAG ( 0, "vps_shvc_reserved_zero_flag" );928 929 #if H_3D930 WRITE_FLAG( 1, "vps_extension2_flag" );931 m_pcBitIf->writeAlignOne();932 for( Int i = 0; i <= pcVPS->getMaxLayers() - 1; i++ )933 {934 if (i!= 0)935 {936 if ( !( pcVPS->getDepthId( i ) == 1 ) )937 {938 #if H_3D_IV_MERGE939 WRITE_FLAG( pcVPS->getIvMvPredFlag ( i ) ? 1 : 0 , "iv_mv_pred_flag[i]");940 #endif941 #if H_3D_ARP942 WRITE_FLAG( pcVPS->getUseAdvRP ( i ) ? 1 : 0, "iv_res_pred_flag[i]" );943 #endif944 #if H_3D_NBDV_REF945 WRITE_FLAG( pcVPS->getDepthRefinementFlag ( i ) ? 1 : 0 , "depth_refinement_flag[i]");946 #endif947 #if H_3D_VSP948 WRITE_FLAG( pcVPS->getViewSynthesisPredFlag( i ) ? 1 : 0 , "view_synthesis_pred_flag[i]");949 #endif950 }951 else952 {953 WRITE_FLAG( pcVPS->getVpsDepthModesFlag( i ) ? 1 : 0 , "vps_depth_modes_flag[i]" );954 //WRITE_FLAG( pcVPS->getLimQtPredFlag ( i ) ? 1 : 0 , "lim_qt_pred_flag[i]" );955 #if H_3D_DIM_DLT956 if( pcVPS->getVpsDepthModesFlag( i ) )957 {958 WRITE_FLAG( pcVPS->getUseDLTFlag( i ) ? 1 : 0, "dlt_flag[i]" );959 }960 if( pcVPS->getUseDLTFlag( i ) )961 {962 // code mapping963 WRITE_UVLC(pcVPS->getNumDepthValues(i), "num_depth_values_in_dlt[i]");964 for(Int d=0; d<pcVPS->getNumDepthValues(i); d++)965 {966 WRITE_UVLC( pcVPS->idx2DepthValue(i, d), "dlt_depth_value[i][d]" );967 }968 }969 #endif970 #if LGE_INTER_SDC_E0156971 WRITE_FLAG( pcVPS->getInterSDCFlag( i ) ? 1 : 0, "depth_inter_SDC_flag" );972 #endif973 }974 }975 }976 WRITE_FLAG( pcVPS->getIvMvScalingFlag( ) ? 1 : 0 , "iv_mv_scaling_flag" );977 #else978 WRITE_FLAG( 0, "vps_extension2_flag" );979 #endif980 #else981 WRITE_FLAG( 0, "vps_extension_flag" );982 #endif983 984 //future extensions here..985 986 return;987 }988 #else989 716 #if H_MV 990 717 WRITE_FLAG( 1, "vps_extension_flag" ); … … 1003 730 #endif 1004 731 //future extensions here.. 1005 } 1006 1007 #endif 1008 1009 1010 #if H_MV5 732 733 return; 734 } 735 736 737 1011 738 #if H_MV 1012 739 Void TEncCavlc::codeVPSExtension( TComVPS *pcVPS ) … … 1309 1036 } 1310 1037 #endif 1311 #if LGE_INTER_SDC_E01561038 #if H_3D_INTER_SDC 1312 1039 WRITE_FLAG( pcVPS->getInterSDCFlag( i ) ? 1 : 0, "depth_inter_SDC_flag" ); 1313 1040 #endif … … 1319 1046 #endif 1320 1047 } 1321 #endif1322 1048 #endif 1323 1049 … … 1370 1096 { 1371 1097 #if H_MV 1372 #if H_MV51373 1098 Int esb = 0; //Don't use i, otherwise will shadow something below 1374 1099 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) … … 1385 1110 1386 1111 for (; esb < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); esb++) 1387 #else1388 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 )1389 {1390 WRITE_FLAG( pcSlice->getDiscardableFlag( ) ? 1 : 0 , "discardable_flag" );1391 }1392 1393 for (Int i = 1; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++)1394 #endif1395 1112 #else 1396 1113 for (Int i = 0; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) … … 1415 1132 if( !pcSlice->getIdrPicFlag() ) 1416 1133 { 1417 Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) %(1<<pcSlice->getSPS()->getBitsForPOC());1134 Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1); 1418 1135 WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb"); 1419 1136 TComReferencePictureSet* rps = pcSlice->getRPS(); … … 1530 1247 } 1531 1248 #if H_MV 1532 #if H_MV51533 1249 Int layerId = pcSlice->getLayerId(); 1534 1250 if( pcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumDirectRefLayers( layerId ) > 0 ) … … 1550 1266 } 1551 1267 } 1552 #else1553 Int layerIdInVps = pcSlice->getLayerIdInVps();1554 if( pcSlice->getLayerId() > 0 && vps->getNumDirectRefLayers( layerIdInVps ) > 0 )1555 {1556 WRITE_FLAG( pcSlice->getInterLayerPredEnabledFlag( ) ? 1 : 0 , "inter_layer_pred_enabled_flag" );1557 if( pcSlice->getInterLayerPredEnabledFlag() && vps->getNumDirectRefLayers( layerIdInVps ) > 1 )1558 {1559 if( !vps->getMaxOneActiveRefLayerFlag())1560 {1561 WRITE_CODE( pcSlice->getNumInterLayerRefPicsMinus1( ), pcSlice->getNumInterLayerRefPicsMinus1Len( ), "num_inter_layer_ref_pics_minus1" );1562 }1563 for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ )1564 {1565 WRITE_CODE( pcSlice->getInterLayerPredLayerIdc( i ), pcSlice->getInterLayerPredLayerIdcLen( ), "inter_layer_pred_layer_idc" );1566 }1567 }1568 }1569 1570 if( vps->getNumSamplePredRefLayers( layerIdInVps ) > 0 && pcSlice->getNumActiveRefLayerPics() > 0 )1571 {1572 WRITE_FLAG( pcSlice->getInterLayerSamplePredOnlyFlag( ) ? 1 : 0 , "inter_layer_sample_pred_only_flag" );1573 }1574 1575 #endif1576 1268 #endif 1577 1269 if(pcSlice->getSPS()->getUseSAO()) … … 1678 1370 if ( pcSlice->getEnableTMVPFlag() ) 1679 1371 { 1680 #if !H_MV51681 #if H_MV1682 if( pcSlice->getLayerId() > 0 && pcSlice->getNumActiveMotionPredRefLayers() > 0 )1683 {1684 WRITE_FLAG( pcSlice->getAltCollocatedIndicationFlag( ) ? 1 : 0 , "alt_collocated_indication_flag" );1685 }1686 if( pcSlice->getAltCollocatedIndicationFlag() && pcSlice->getNumActiveMotionPredRefLayers() > 1 )1687 {1688 WRITE_UVLC( pcSlice->getCollocatedRefLayerIdx( ), "collocated_ref_layer_idx" );1689 }1690 else1691 {1692 #endif1693 #endif1694 1372 if ( pcSlice->getSliceType() == B_SLICE ) 1695 1373 { … … 1704 1382 } 1705 1383 } 1706 #if !H_MV51707 #if H_MV1708 }1709 #endif1710 #endif1711 1384 if ( (pcSlice->getPPS()->getUseWP() && pcSlice->getSliceType()==P_SLICE) || (pcSlice->getPPS()->getWPBiPred() && pcSlice->getSliceType()==B_SLICE) ) 1712 1385 { … … 2256 1929 { 2257 1930 // Bool state = true, state2 = false; 2258 Int lsb = ltrpPOC % (1<<pcSlice->getSPS()->getBitsForPOC());1931 Int lsb = ltrpPOC & ((1<<pcSlice->getSPS()->getBitsForPOC())-1); 2259 1932 for (Int k = 0; k < pcSlice->getSPS()->getNumLongTermRefPicSPS(); k++) 2260 1933 { … … 2282 1955 } 2283 1956 2284 #if LGE_INTER_SDC_E01561957 #if H_3D_INTER_SDC 2285 1958 Void TEncCavlc::codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2286 1959 { -
TabularUnified trunk/source/Lib/TLibEncoder/TEncCavlc.h ¶
r622 r655 84 84 UInt getCoeffCost () { return m_uiCoeffCost; } 85 85 Void codeVPS ( TComVPS* pcVPS ); 86 #if H_MV587 86 #if H_MV 88 87 Void codeVPSExtension ( TComVPS *pcVPS ); … … 90 89 Void codeVPSVUI ( TComVPS* pcVPS ); 91 90 #endif 92 #endif93 91 Void codeVUI ( TComVUI *pcVUI, TComSPS* pcSPS ); 94 #if H_MV595 92 #if H_MV 96 93 Void codeSPSExtension ( TComSPS* pcSPS ); 97 94 #endif 98 #endif99 95 #if H_3D 100 #if H_MV5101 96 Void codeVPSExtension2 ( TComVPS* pcVPS ); 102 97 Void codeSPSExtension2 ( TComSPS* pcSPS, Int viewIndex, Bool depthFlag ); 103 #endif104 98 Void codeSPS ( TComSPS* pcSPS, Int viewIndex, Bool depthFlag ); 105 99 #else … … 133 127 Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 134 128 #endif 135 #if LGE_INTER_SDC_E0156129 #if H_3D_INTER_SDC 136 130 Void codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 137 131 Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ); -
TabularUnified trunk/source/Lib/TLibEncoder/TEncCfg.h ¶
r622 r655 77 77 Int m_interLayerPredLayerIdc [MAX_NUM_REF_PICS]; 78 78 Int m_interViewRefPosL[2][MAX_NUM_REF_PICS]; 79 #if !H_MV580 Int m_collocatedRefLayerIdx;81 #endif82 79 #endif 83 80 GOPEntry() … … 97 94 #if H_MV 98 95 , m_numActiveRefLayerPics(0) 99 #if !H_MV5100 , m_collocatedRefLayerIdx(-1)101 #endif102 96 #endif 103 97 { … … 310 304 Int m_RCInitialQP; 311 305 Bool m_RCForceIntraQP; 306 307 #if KWU_RC_MADPRED_E0227 308 UInt m_depthMADPred; 309 #endif 310 #if KWU_RC_VIEWRC_E0227 311 Bool m_bViewWiseRateCtrl; 312 #endif 312 313 #else 313 314 Bool m_enableRateCtrl; ///< Flag for using rate control algorithm 314 315 Int m_targetBitrate; ///< target bitrate 315 316 Int m_numLCUInUnit; ///< Total number of LCUs in a frame should be divided by the NumLCUInUnit 317 318 #if KWU_RC_MADPRED_E0227 319 UInt m_depthMADPred; 320 #endif 321 #if KWU_RC_VIEWRC_E0227 322 Bool m_bViewWiseRateCtrl; 323 #endif 316 324 #endif 317 325 Bool m_TransquantBypassEnableFlag; ///< transquant_bypass_enable_flag setting in PPS. … … 361 369 Int m_layerIdInVps; 362 370 Int m_viewId; 363 #if H_MV5364 371 Int m_viewIndex; 365 #endif366 372 #endif 367 373 368 374 #if H_3D 369 #if !H_MV5370 Int m_viewIndex;371 #endif372 375 Bool m_isDepth; 373 376 … … 403 406 Bool m_bUseIC; 404 407 #endif 405 #if LGE_INTER_SDC_E0156408 #if H_3D_INTER_SDC 406 409 bool m_bInterSDC; 407 410 #endif … … 426 429 , m_layerIdInVps(-1) 427 430 , m_viewId(-1) 428 #if H_MV5429 431 , m_viewIndex(-1) 430 #endif431 432 #if H_3D 432 #if !H_MV5433 , m_viewIndex(-1)434 #endif435 433 , m_isDepth(false) 436 434 , m_bUseVSO(false) … … 465 463 Void setViewId ( Int viewId ) { m_viewId = viewId; } 466 464 Int getViewId () { return m_viewId; } 467 #if H_MV5468 465 Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; } 469 466 Int getViewIndex () { return m_viewIndex; } 470 #endif471 467 #if H_3D 472 #if !H_MV5473 Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; }474 Int getViewIndex () { return m_viewIndex; }475 #endif476 468 Void setIsDepth ( Bool isDepth ) { m_isDepth = isDepth; } 477 469 Bool getIsDepth () { return m_isDepth; } … … 514 506 Bool getUseIC () { return m_bUseIC; } 515 507 #endif 516 #if LGE_INTER_SDC_E0156508 #if H_3D_INTER_SDC 517 509 Void setInterSDCEnable ( Bool bVal ) { m_bInterSDC = bVal; } 518 510 Bool getInterSDCEnable () { return m_bInterSDC; } … … 826 818 Bool getForceIntraQP () { return m_RCForceIntraQP; } 827 819 Void setForceIntraQP ( Bool b ) { m_RCForceIntraQP = b; } 820 821 #if KWU_RC_MADPRED_E0227 822 UInt getUseDepthMADPred () { return m_depthMADPred; } 823 Void setUseDepthMADPred (UInt b) { m_depthMADPred = b; } 824 #endif 825 #if KWU_RC_VIEWRC_E0227 826 Bool getUseViewWiseRateCtrl () { return m_bViewWiseRateCtrl; } 827 Void setUseViewWiseRateCtrl (Bool b) { m_bViewWiseRateCtrl = b; } 828 #endif 828 829 #else 829 830 Bool getUseRateCtrl () { return m_enableRateCtrl; } … … 833 834 Int getNumLCUInUnit () { return m_numLCUInUnit; } 834 835 Void setNumLCUInUnit (Int numLCUs) { m_numLCUInUnit = numLCUs; } 836 837 #if KWU_RC_MADPRED_E0227 838 UInt getUseDepthMADPred () { return m_depthMADPred; } 839 Void setUseDepthMADPred (UInt b) { m_depthMADPred = b; } 840 #endif 841 #if KWU_RC_VIEWRC_E0227 842 Bool getUseViewWiseRateCtrl () { return m_bViewWiseRateCtrl; } 843 Void setUseViewWiseRateCtrl (Bool b) { m_bViewWiseRateCtrl = b; } 844 #endif 835 845 #endif 836 846 Bool getTransquantBypassEnableFlag() { return m_TransquantBypassEnableFlag; } -
TabularUnified trunk/source/Lib/TLibEncoder/TEncCu.cpp ¶
r622 r655 103 103 104 104 m_bEncodeDQP = false; 105 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 105 #if RATE_CONTROL_LAMBDA_DOMAIN 106 #if !M0036_RC_IMPROVEMENT 106 107 m_LCUPredictionSAD = 0; 107 108 m_addSADDepth = 0; 108 109 m_temporalSAD = 0; 110 #endif 111 #if M0036_RC_IMPROVEMENT && KWU_RC_MADPRED_E0227 112 m_LCUPredictionSAD = 0; 113 m_addSADDepth = 0; 114 m_temporalSAD = 0; 115 m_spatialSAD = 0; 116 #endif 117 #endif 118 #if !RATE_CONTROL_LAMBDA_DOMAIN && KWU_RC_MADPRED_E0227 119 m_LCUPredictionSAD = 0; 120 m_addSADDepth = 0; 121 m_temporalSAD = 0; 122 m_spatialSAD = 0; 109 123 #endif 110 124 … … 256 270 m_ppcTempCU[0]->initCU( rpcCU->getPic(), rpcCU->getAddr() ); 257 271 258 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 272 #if RATE_CONTROL_LAMBDA_DOMAIN 273 #if !M0036_RC_IMPROVEMENT 259 274 m_addSADDepth = 0; 260 275 m_LCUPredictionSAD = 0; 261 276 m_temporalSAD = 0; 277 #endif 278 #if M0036_RC_IMPROVEMENT && KWU_RC_MADPRED_E0227 279 m_LCUPredictionSAD = 0; 280 m_addSADDepth = 0; 281 m_temporalSAD = 0; 282 m_spatialSAD = 0; 283 #endif 284 #endif 285 #if KWU_RC_MADPRED_E0227 286 m_LCUPredictionSAD = 0; 287 m_addSADDepth = 0; 288 m_temporalSAD = 0; 289 m_spatialSAD = 0; 262 290 #endif 263 291 … … 404 432 405 433 // variables for fast encoder decision 406 Bool bEarlySkip = false; 407 Bool bTrySplit = true; 408 Double fRD_Skip = MAX_DOUBLE; 434 #if H_3D_QTLPC 435 Bool bTrySplit = true; 436 Bool bTrySplitDQP = true; 437 #endif 409 438 410 439 // variable for Early CU determination … … 415 444 Bool earlyDetectionSkipMode = false; 416 445 417 Bool bTrySplitDQP = true;418 446 #if H_3D_VSP 419 447 DisInfo DvInfo; … … 425 453 #endif 426 454 #endif 427 static Double afCost[ MAX_CU_DEPTH ];428 static Int aiNum [ MAX_CU_DEPTH ];429 430 if ( rpcBestCU->getAddr() == 0 )431 {432 ::memset( afCost, 0, sizeof( afCost ) );433 ::memset( aiNum, 0, sizeof( aiNum ) );434 }435 436 455 Bool bBoundary = false; 437 456 UInt uiLPelX = rpcBestCU->getCUPelX(); … … 489 508 if(!bSliceEnd && !bSliceStart && bInsidePicture ) 490 509 { 491 #if MTK_FAST_TEXTURE_ENCODING_E0173510 #if H_3D_FAST_TEXTURE_ENCODING 492 511 Bool bIVFMerge = false; 493 512 Int iIVFMaxD = 0; … … 501 520 } 502 521 // variables for fast encoder decision 503 bEarlySkip = false; 522 #if H_3D_QTLPC 504 523 bTrySplit = true; 505 fRD_Skip = MAX_DOUBLE; 524 #endif 506 525 507 526 rpcTempCU->initEstData( uiDepth, iQP ); … … 560 579 } 561 580 } 562 #if MTK_FAST_TEXTURE_ENCODING_E0173581 #if H_3D_FAST_TEXTURE_ENCODING 563 582 if(rpcTempCU->getSlice()->getViewIndex() && !rpcTempCU->getSlice()->getIsDepth()) 564 583 { … … 584 603 rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth); 585 604 #endif 586 #if MTK_FAST_TEXTURE_ENCODING_E0173605 #if H_3D_FAST_TEXTURE_ENCODING 587 606 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bFMD ); rpcTempCU->initEstData( uiDepth, iQP );//by Competition for inter_2Nx2N 588 607 #else … … 598 617 #endif 599 618 xCheckRDCostMerge2Nx2N( rpcBestCU, rpcTempCU, &earlyDetectionSkipMode );//by Merge for inter_2Nx2N 600 #if MTK_FAST_TEXTURE_ENCODING_E0173619 #if H_3D_FAST_TEXTURE_ENCODING 601 620 bFMD = bIVFMerge && rpcBestCU->isSkipped(0); 602 621 #endif … … 605 624 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 606 625 #endif 607 // fast encoder decision for early skip608 if ( m_pcEncCfg->getUseFastEnc() )609 {610 Int iIdx = g_aucConvertToBit[ rpcBestCU->getWidth(0) ];611 if ( aiNum [ iIdx ] > 5 && fRD_Skip < EARLY_SKIP_THRES*afCost[ iIdx ]/aiNum[ iIdx ] )612 {613 bEarlySkip = true;614 bTrySplit = false;615 }616 }617 626 618 627 if(!m_pcEncCfg->getUseEarlySkipDetection()) 619 628 { 620 629 // 2Nx2N, NxN 621 if ( !bEarlySkip )622 {623 630 #if H_3D_IC 624 631 rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth); 625 632 #endif 626 #if MTK_FAST_TEXTURE_ENCODING_E0173633 #if H_3D_FAST_TEXTURE_ENCODING 627 634 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bFMD ); rpcTempCU->initEstData( uiDepth, iQP ); 628 635 #else … … 636 643 doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0; 637 644 } 638 }639 645 } 640 646 #if H_3D_IC … … 643 649 } 644 650 645 #if H_3D_QTLPC 651 #if H_3D_QTLPC 646 652 if(depthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL()) 647 653 { 648 654 bTrySplitDQP = bTrySplit; 649 655 } 650 else651 {652 #endif653 if( (g_uiMaxCUWidth>>uiDepth) >= rpcTempCU->getSlice()->getPPS()->getMinCuDQPSize() )654 {655 if(iQP == iBaseQP)656 {657 bTrySplitDQP = bTrySplit;658 }659 }660 else661 {662 bTrySplitDQP = bTrySplit;663 }664 #if H_3D_QTLPC665 }666 656 #endif 667 657 if (isAddLowestQP && (iQP == lowestQP)) … … 678 668 } 679 669 #endif 670 #if RATE_CONTROL_LAMBDA_DOMAIN && M0036_RC_IMPROVEMENT && KWU_RC_MADPRED_E0227 671 if ( uiDepth <= m_addSADDepth ) 672 { 673 m_LCUPredictionSAD += m_temporalSAD; 674 m_addSADDepth = uiDepth; 675 } 676 #endif 677 #if !RATE_CONTROL_LAMBDA_DOMAIN && KWU_RC_MADPRED_E0227 678 if ( uiDepth <= m_addSADDepth ) 679 { 680 m_LCUPredictionSAD += m_temporalSAD; 681 m_addSADDepth = uiDepth; 682 } 683 #endif 684 #if !RATE_CONTROL_LAMBDA_DOMAIN && KWU_FIX_URQ 685 if(m_pcEncCfg->getUseRateCtrl()) 686 { 687 Int qp = m_pcRateCtrl->getUnitQP(); 688 iMinQP = Clip3( MIN_QP, MAX_QP, qp); 689 iMaxQP = Clip3( MIN_QP, MAX_QP, qp); 690 } 691 #endif 680 692 681 693 #if H_3D_DIM_ENC … … 700 712 { 701 713 // 2Nx2N, NxN 702 if ( !bEarlySkip )703 {704 714 if(!( (rpcBestCU->getWidth(0)==8) && (rpcBestCU->getHeight(0)==8) )) 705 715 { … … 710 720 ) 711 721 { 712 #if MTK_FAST_TEXTURE_ENCODING_E0173722 #if H_3D_FAST_TEXTURE_ENCODING 713 723 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_NxN, bFMD ); 714 724 #else … … 721 731 } 722 732 } 723 }724 733 725 734 // 2NxN, Nx2N … … 730 739 ) 731 740 { 732 #if MTK_FAST_TEXTURE_ENCODING_E0173741 #if H_3D_FAST_TEXTURE_ENCODING 733 742 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_Nx2N, bFMD ); 734 743 #else … … 750 759 ) 751 760 { 752 #if MTK_FAST_TEXTURE_ENCODING_E0173761 #if H_3D_FAST_TEXTURE_ENCODING 753 762 xCheckRDCostInter ( rpcBestCU, rpcTempCU, SIZE_2NxN, bFMD ); 754 763 #else … … 789 798 ) 790 799 { 791 #if MTK_FAST_TEXTURE_ENCODING_E0173800 #if H_3D_FAST_TEXTURE_ENCODING 792 801 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU, bFMD ); 793 802 #else … … 809 818 ) 810 819 { 811 #if MTK_FAST_TEXTURE_ENCODING_E0173820 #if H_3D_FAST_TEXTURE_ENCODING 812 821 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD, bFMD ); 813 822 #else … … 833 842 ) 834 843 { 835 #if MTK_FAST_TEXTURE_ENCODING_E0173844 #if H_3D_FAST_TEXTURE_ENCODING 836 845 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU, bFMD, true ); 837 846 #else … … 853 862 ) 854 863 { 855 #if MTK_FAST_TEXTURE_ENCODING_E0173864 #if H_3D_FAST_TEXTURE_ENCODING 856 865 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD, bFMD, true ); 857 866 #else … … 879 888 ) 880 889 { 881 #if MTK_FAST_TEXTURE_ENCODING_E0173890 #if H_3D_FAST_TEXTURE_ENCODING 882 891 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N, bFMD ); 883 892 #else … … 899 908 ) 900 909 { 901 #if MTK_FAST_TEXTURE_ENCODING_E0173910 #if H_3D_FAST_TEXTURE_ENCODING 902 911 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N, bFMD ); 903 912 #else … … 919 928 ) 920 929 { 921 #if MTK_FAST_TEXTURE_ENCODING_E0173930 #if H_3D_FAST_TEXTURE_ENCODING 922 931 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N, bFMD, true ); 923 932 #else … … 939 948 ) 940 949 { 941 #if MTK_FAST_TEXTURE_ENCODING_E0173950 #if H_3D_FAST_TEXTURE_ENCODING 942 951 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N, bFMD, true ); 943 952 #else … … 990 999 #endif 991 1000 } 992 #if MTK_FAST_TEXTURE_ENCODING_E01731001 #if H_3D_FAST_TEXTURE_ENCODING 993 1002 if(!bFMD) 994 1003 { 995 1004 #endif 996 1005 // do normal intra modes 997 #if H_3D_DIM_ENC 998 if ( !bEarlySkip || ( rpcBestCU->getSlice()->getIsDepth() && rpcBestCU->getSlice()->isIRAP() ) ) 999 #else 1000 if ( !bEarlySkip ) 1001 #endif 1002 { 1006 1003 1007 // speedup for inter frames 1004 1008 if( rpcBestCU->getSlice()->getSliceType() == I_SLICE || … … 1012 1016 { 1013 1017 xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); 1018 1019 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT && KWU_RC_MADPRED_E0227 1020 if ( uiDepth <= m_addSADDepth ) 1021 { 1022 m_LCUPredictionSAD += m_spatialSAD; 1023 m_addSADDepth = uiDepth; 1024 } 1025 #endif 1026 #if RATE_CONTROL_LAMBDA_DOMAIN && M0036_RC_IMPROVEMENT && KWU_RC_MADPRED_E0227 1027 if ( uiDepth <= m_addSADDepth ) 1028 { 1029 m_LCUPredictionSAD += m_spatialSAD; 1030 m_addSADDepth = uiDepth; 1031 } 1032 #endif 1033 1034 #if !RATE_CONTROL_LAMBDA_DOMAIN && KWU_RC_MADPRED_E0227 1035 if ( uiDepth <= m_addSADDepth ) 1036 { 1037 m_LCUPredictionSAD += m_spatialSAD; 1038 m_addSADDepth = uiDepth; 1039 } 1040 #endif 1014 1041 rpcTempCU->initEstData( uiDepth, iQP ); 1015 1042 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth ) … … 1029 1056 } 1030 1057 } 1031 }1032 1033 1058 // test PCM 1034 1059 if(pcPic->getSlice(0)->getSPS()->getUsePCM() … … 1049 1074 } 1050 1075 } 1051 #if MTK_FAST_TEXTURE_ENCODING_E01731076 #if H_3D_FAST_TEXTURE_ENCODING 1052 1077 } 1053 1078 #endif … … 1074 1099 rpcBestCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcBestCU->getTotalBits(), rpcBestCU->getTotalDistortion() ); 1075 1100 1076 // accumulate statistics for early skip1077 if ( m_pcEncCfg->getUseFastEnc() )1078 {1079 if ( rpcBestCU->isSkipped(0) )1080 {1081 Int iIdx = g_aucConvertToBit[ rpcBestCU->getWidth(0) ];1082 afCost[ iIdx ] += rpcBestCU->getTotalCost();1083 aiNum [ iIdx ] ++;1084 }1085 }1086 1087 1101 // Early CU determination 1088 1102 if( m_pcEncCfg->getUseEarlyCU() && rpcBestCU->isSkipped(0) ) … … 1094 1108 bSubBranch = true; 1095 1109 } 1096 #if MTK_FAST_TEXTURE_ENCODING_E01731110 #if H_3D_FAST_TEXTURE_ENCODING 1097 1111 if(rpcBestCU->getSlice()->getViewIndex() && !rpcBestCU->getSlice()->getIsDepth() && (uiDepth >=iIVFMaxD) && rpcBestCU->isSkipped(0)) 1098 1112 { … … 1168 1182 1169 1183 // further split 1184 #if H_3D_QTLPC 1170 1185 if( bSubBranch && bTrySplitDQP && uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth ) 1186 #else 1187 if( bSubBranch && uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth ) 1188 #endif 1171 1189 { 1172 1190 #if H_3D_VSO // M9 … … 1580 1598 m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx ); 1581 1599 #endif 1582 #if LGE_INTER_SDC_E01561600 #if H_3D_INTER_SDC 1583 1601 m_pcEntropyCoder->encodeInterSDCFlag( pcCU, uiAbsPartIdx, false ); 1584 1602 #endif … … 1875 1893 1876 1894 rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth ); 1877 #if LGE_INTER_SDC_E01561895 #if H_3D_INTER_SDC 1878 1896 TComDataCU *rpcTempCUPre = rpcTempCU; 1879 1897 #endif … … 1881 1899 xCheckDQP( rpcTempCU ); 1882 1900 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 1883 #if LGE_INTER_SDC_E01561901 #if H_3D_INTER_SDC 1884 1902 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && !uiNoResidual ) 1885 1903 { … … 1917 1935 if( m_pcEncCfg->getUseFastDecisionForMerge() && !bestIsSkip ) 1918 1936 { 1919 #if LGE_INTER_SDC_E01561937 #if H_3D_INTER_SDC 1920 1938 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) ) 1921 1939 { … … 1926 1944 #endif 1927 1945 bestIsSkip = rpcBestCU->getQtRootCbf(0) == 0; 1928 #if LGE_INTER_SDC_E01561946 #if H_3D_INTER_SDC 1929 1947 } 1930 1948 #endif … … 1971 1989 1972 1990 #if AMP_MRG 1973 #if MTK_FAST_TEXTURE_ENCODING_E01731991 #if H_3D_FAST_TEXTURE_ENCODING 1974 1992 Void TEncCu::xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bFMD, Bool bUseMRG) 1975 1993 #else … … 1980 1998 #endif 1981 1999 { 1982 #if MTK_FAST_TEXTURE_ENCODING_E01732000 #if H_3D_FAST_TEXTURE_ENCODING 1983 2001 if(!(bFMD && (ePartSize == SIZE_2Nx2N))) //have motion estimation or merge check 1984 2002 { … … 2057 2075 #if AMP_MRG 2058 2076 rpcTempCU->setMergeAMP (true); 2059 #if MTK_FAST_TEXTURE_ENCODING_E01732077 #if H_3D_FAST_TEXTURE_ENCODING 2060 2078 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bFMD, false, bUseMRG ); 2061 2079 #else … … 2102 2120 #endif 2103 2121 2104 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT2122 #if RATE_CONTROL_LAMBDA_DOMAIN && (!M0036_RC_IMPROVEMENT || KWU_RC_MADPRED_E0227) 2105 2123 if ( m_pcEncCfg->getUseRateCtrl() && m_pcEncCfg->getLCULevelRC() && ePartSize == SIZE_2Nx2N && uhDepth <= m_addSADDepth ) 2106 2124 { … … 2111 2129 } 2112 2130 #endif 2131 #if !RATE_CONTROL_LAMBDA_DOMAIN && KWU_RC_MADPRED_E0227 2132 if ( m_pcEncCfg->getUseRateCtrl() && ePartSize == SIZE_2Nx2N && uhDepth <= m_addSADDepth ) 2133 { 2134 UInt SAD = m_pcRdCost->getSADPart( g_bitDepthY, m_ppcPredYuvTemp[uhDepth]->getLumaAddr(), m_ppcPredYuvTemp[uhDepth]->getStride(), 2135 m_ppcOrigYuv[uhDepth]->getLumaAddr(), m_ppcOrigYuv[uhDepth]->getStride(), 2136 rpcTempCU->getWidth(0), rpcTempCU->getHeight(0) ); 2137 m_temporalSAD = (Int)SAD; 2138 } 2139 #endif 2113 2140 2114 2141 m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], false ); … … 2121 2148 #endif 2122 2149 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 2123 #if LGE_INTER_SDC_E01562150 #if H_3D_INTER_SDC 2124 2151 TComDataCU *rpcTempCUPre = rpcTempCU; 2125 2152 #endif 2126 2153 xCheckDQP( rpcTempCU ); 2127 2154 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2128 #if LGE_INTER_SDC_E01562155 #if H_3D_INTER_SDC 2129 2156 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() ) 2130 2157 { … … 2163 2190 } 2164 2191 #endif 2165 #if MTK_FAST_TEXTURE_ENCODING_E01732192 #if H_3D_FAST_TEXTURE_ENCODING 2166 2193 } 2167 2194 #endif … … 2235 2262 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 2236 2263 2264 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT && KWU_RC_MADPRED_E0227 2265 UChar uhDepth = rpcTempCU->getDepth( 0 ); 2266 if ( m_pcEncCfg->getUseRateCtrl() && m_pcEncCfg->getLCULevelRC() && eSize == SIZE_2Nx2N && uhDepth <= m_addSADDepth ) 2267 { 2268 UInt SAD = m_pcRdCost->getSADPart( g_bitDepthY, m_ppcPredYuvTemp[uhDepth]->getLumaAddr(), m_ppcPredYuvTemp[uhDepth]->getStride(), 2269 m_ppcOrigYuv[uhDepth]->getLumaAddr(), m_ppcOrigYuv[uhDepth]->getStride(), 2270 rpcTempCU->getWidth(0), rpcTempCU->getHeight(0) ); 2271 m_spatialSAD = (Int)SAD; 2272 } 2273 #endif 2274 #if RATE_CONTROL_LAMBDA_DOMAIN && M0036_RC_IMPROVEMENT && KWU_RC_MADPRED_E0227 2275 UChar uhDepth = rpcTempCU->getDepth( 0 ); 2276 if ( m_pcEncCfg->getUseRateCtrl() && m_pcEncCfg->getLCULevelRC() && eSize == SIZE_2Nx2N && uhDepth <= m_addSADDepth ) 2277 { 2278 UInt SAD = m_pcRdCost->getSADPart( g_bitDepthY, m_ppcPredYuvTemp[uhDepth]->getLumaAddr(), m_ppcPredYuvTemp[uhDepth]->getStride(), 2279 m_ppcOrigYuv[uhDepth]->getLumaAddr(), m_ppcOrigYuv[uhDepth]->getStride(), 2280 rpcTempCU->getWidth(0), rpcTempCU->getHeight(0) ); 2281 m_spatialSAD = (Int)SAD; 2282 } 2283 #endif 2284 #if !RATE_CONTROL_LAMBDA_DOMAIN && KWU_RC_MADPRED_E0227 2285 UChar uhDepth = rpcTempCU->getDepth( 0 ); 2286 if ( m_pcEncCfg->getUseRateCtrl() && eSize == SIZE_2Nx2N && uhDepth <= m_addSADDepth ) 2287 { 2288 UInt SAD = m_pcRdCost->getSADPart( g_bitDepthY, m_ppcPredYuvTemp[uhDepth]->getLumaAddr(), m_ppcPredYuvTemp[uhDepth]->getStride(), 2289 m_ppcOrigYuv[uhDepth]->getLumaAddr(), m_ppcOrigYuv[uhDepth]->getStride(), 2290 rpcTempCU->getWidth(0), rpcTempCU->getHeight(0) ); 2291 m_spatialSAD = (Int)SAD; 2292 } 2293 #endif 2237 2294 xCheckDQP( rpcTempCU ); 2238 2295 xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth); -
TabularUnified trunk/source/Lib/TLibEncoder/TEncCu.h ¶
r608 r655 102 102 Bool m_bUseSBACRD; 103 103 TEncRateCtrl* m_pcRateCtrl; 104 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 104 #if RATE_CONTROL_LAMBDA_DOMAIN 105 #if !M0036_RC_IMPROVEMENT 105 106 UInt m_LCUPredictionSAD; 106 107 Int m_addSADDepth; 107 108 Int m_temporalSAD; 108 109 #endif 110 #if M0036_RC_IMPROVEMENT && KWU_RC_MADPRED_E0227 111 UInt m_LCUPredictionSAD; 112 Int m_addSADDepth; 113 Int m_temporalSAD; 114 Int m_spatialSAD; 115 #endif 116 #endif 117 #if !RATE_CONTROL_LAMBDA_DOMAIN && KWU_RC_MADPRED_E0227 118 UInt m_LCUPredictionSAD; 119 Int m_addSADDepth; 120 Int m_temporalSAD; 121 Int m_spatialSAD; 122 #endif 123 109 124 public: 110 125 /// copy parameters from encoder class … … 124 139 125 140 Void setBitCounter ( TComBitCounter* pcBitCounter ) { m_pcBitCounter = pcBitCounter; } 126 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT141 #if (RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT) || KWU_RC_MADPRED_E0227 127 142 UInt getLCUPredictionSAD() { return m_LCUPredictionSAD; } 128 143 #endif … … 145 160 146 161 #if AMP_MRG 147 #if MTK_FAST_TEXTURE_ENCODING_E0173162 #if H_3D_FAST_TEXTURE_ENCODING 148 163 Void xCheckRDCostInter ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bFMD, Bool bUseMRG = false ) ; 149 164 #else -
TabularUnified trunk/source/Lib/TLibEncoder/TEncEntropy.cpp ¶
r608 r655 662 662 #endif 663 663 664 #if LGE_INTER_SDC_E0156664 #if H_3D_INTER_SDC 665 665 if( pcCU->getInterSDCFlag( uiAbsPartIdx ) ) 666 666 { … … 824 824 } 825 825 826 #if LGE_INTER_SDC_E0156826 #if H_3D_INTER_SDC 827 827 Void TEncEntropy::encodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 828 828 { -
TabularUnified trunk/source/Lib/TLibEncoder/TEncEntropy.h ¶
r608 r655 94 94 virtual Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 95 95 #endif 96 #if LGE_INTER_SDC_E015696 #if H_3D_INTER_SDC 97 97 virtual Void codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 98 98 virtual Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) = 0; … … 185 185 Void encodeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 186 186 #endif 187 #if LGE_INTER_SDC_E0156187 #if H_3D_INTER_SDC 188 188 Void encodeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 189 189 Void encodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ); -
TabularUnified trunk/source/Lib/TLibEncoder/TEncGOP.cpp ¶
r622 r655 153 153 #endif 154 154 #endif 155 156 #if KWU_FIX_URQ 157 m_pcRateCtrl = pcTEncTop->getRateCtrl(); 158 #endif 155 159 } 156 160 … … 351 355 #endif 352 356 #if H_MV 353 Void TEncGOP::compressPicInGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP, Int iGOPid )354 #else 355 Void TEncGOP::compressGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP )357 Void TEncGOP::compressPicInGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP, Int iGOPid, bool isField, bool isTff) 358 #else 359 Void TEncGOP::compressGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP, bool isField, bool isTff) 356 360 #endif 357 361 { … … 367 371 368 372 #if !H_MV 369 xInitGOP( iPOCLast, iNumPicRcvd, rcListPic, rcListPicYuvRecOut ); 373 xInitGOP( iPOCLast, iNumPicRcvd, rcListPic, rcListPicYuvRecOut, isField ); 374 370 375 371 376 m_iNumPicCoded = 0; … … 439 444 440 445 /////////////////////////////////////////////////////////////////////////////////////////////////// Initial to start encoding 441 Int pocCurr = iPOCLast -iNumPicRcvd+ m_pcCfg->getGOPEntry(iGOPid).m_POC; 442 Int iTimeOffset = m_pcCfg->getGOPEntry(iGOPid).m_POC; 443 if(iPOCLast == 0) 446 Int iTimeOffset; 447 Int pocCurr; 448 449 if(iPOCLast == 0) //case first frame or first top field 444 450 { 445 451 pocCurr=0; 446 452 iTimeOffset = 1; 453 } 454 else if(iPOCLast == 1 && isField) //case first bottom field, just like the first frame, the poc computation is not right anymore, we set the right value 455 { 456 pocCurr = 1; 457 iTimeOffset = 1; 458 } 459 else 460 { 461 pocCurr = iPOCLast - iNumPicRcvd + m_pcCfg->getGOPEntry(iGOPid).m_POC - isField; 462 iTimeOffset = m_pcCfg->getGOPEntry(iGOPid).m_POC; 447 463 } 448 464 if(pocCurr>=m_pcCfg->getFramesToBeEncoded()) … … 463 479 accessUnitsInGOP.push_back(AccessUnit()); 464 480 AccessUnit& accessUnit = accessUnitsInGOP.back(); 465 xGetBuffer( rcListPic, rcListPicYuvRecOut, iNumPicRcvd, iTimeOffset, pcPic, pcPicYuvRecOut, pocCurr 481 xGetBuffer( rcListPic, rcListPicYuvRecOut, iNumPicRcvd, iTimeOffset, pcPic, pcPicYuvRecOut, pocCurr, isField); 466 482 467 483 // Slice data initialization … … 472 488 473 489 474 #if H_MV5475 490 #if H_MV 476 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getVPS(), m_pcEncTop->getSPS(), m_pcEncTop->getPPS(), getLayerId() ); 477 #else 478 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getSPS(), m_pcEncTop->getPPS() ); 479 #endif 480 #else 481 #if H_3D 482 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getVPS(), m_pcEncTop->getSPS(), m_pcEncTop->getPPS(), getLayerId() ); 483 #else 484 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getSPS(), m_pcEncTop->getPPS() ); 485 #endif 486 #endif 491 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getVPS(), m_pcEncTop->getSPS(), m_pcEncTop->getPPS(), getLayerId(), isField ); 492 #else 493 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getSPS(), m_pcEncTop->getPPS(), isField ); 494 #endif 495 496 //Set Frame/Field coding 497 pcSlice->getPic()->setField(isField); 498 487 499 pcSlice->setLastIDR(m_iLastIDR); 488 500 pcSlice->setSliceIdx(0); 489 501 #if H_MV 490 #if H_MV5491 502 pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer0, &m_refPicSetInterLayer1 ); 492 #else493 pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer );494 #endif495 503 pcPic ->setLayerId ( getLayerId() ); 496 504 pcPic ->setViewId ( getViewId() ); … … 508 516 pcSlice->setLFCrossSliceBoundaryFlag( pcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag() ); 509 517 pcSlice->setScalingList ( m_pcEncTop->getScalingList() ); 510 pcSlice->getScalingList()->setUseTransformSkip(m_pcEncTop->getPPS()->getUseTransformSkip());511 518 if(m_pcEncTop->getUseScalingListId() == SCALING_LIST_OFF) 512 519 { … … 562 569 if(pcSlice->getTemporalLayerNonReferenceFlag()) 563 570 { 564 if(pcSlice->getNalUnitType()==NAL_UNIT_CODED_SLICE_TRAIL_R) 571 if (pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL_R && 572 !(m_iGopSize == 1 && pcSlice->getSliceType() == I_SLICE)) 573 // Add this condition to avoid POC issues with encoder_intra_main.cfg configuration (see #1127 in bug tracker) 565 574 { 566 575 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_TRAIL_N); … … 655 664 refPicListModification->setRefPicListModificationFlagL1(0); 656 665 #if H_MV 657 #if H_MV5658 666 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 1 ) 659 667 { … … 699 707 xSetRefPicListModificationsMv( tempRefPicLists, pcSlice, iGOPid ); 700 708 #else 701 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 )702 {703 pcSlice->setDiscardableFlag ( false );704 }705 706 TComVPS* vps = pcSlice->getVPS();707 Int layerIdInVps = vps ->getLayerIdInVps( getLayerId());708 Int numDirectRefLayers = vps ->getNumDirectRefLayers( layerIdInVps );709 GOPEntry gopEntry = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid );710 711 if ( getLayerId() > 0 && numDirectRefLayers > 0 )712 {713 pcSlice->setInterLayerPredEnabledFlag ( gopEntry.m_numActiveRefLayerPics > 0 );714 if ( pcSlice->getInterLayerPredEnabledFlag() && numDirectRefLayers > 1 )715 {716 if ( !vps->getMaxOneActiveRefLayerFlag() )717 {718 pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 );719 }720 for (Int i = 0; i < gopEntry.m_numActiveRefLayerPics; i++ )721 {722 pcSlice->setInterLayerPredLayerIdc( i, gopEntry.m_interLayerPredLayerIdc[ i ] );723 }724 }725 }726 assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics );727 728 if ( vps->getNumSamplePredRefLayers( layerIdInVps ) > 0 && pcSlice->getNumActiveRefLayerPics() > 0)729 {730 pcSlice->setInterLayerSamplePredOnlyFlag( gopEntry.m_numRefPics == 0 );731 }732 733 pcSlice->createAndApplyIvReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer );734 pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer.size() ) ) );735 pcSlice->setNumRefIdx(REF_PIC_LIST_1,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer.size() ) ) );736 737 xSetRefPicListModificationsMv( pcSlice, iGOPid );738 739 pcSlice->setActiveMotionPredRefLayers( );740 741 if ( getLayerId() > 0 && pcSlice->getNumActiveMotionPredRefLayers() > 0 && pcSlice->getEnableTMVPFlag() &&742 ( pcSlice->getSliceType() == B_SLICE || pcSlice->getSliceType() == P_SLICE ))743 {744 pcSlice->setAltCollocatedIndicationFlag( gopEntry.m_collocatedRefLayerIdx >= 0 );745 if ( pcSlice->getNumActiveRefLayerPics() && pcSlice->getNumActiveMotionPredRefLayers() > 0 )746 {747 pcSlice->setCollocatedRefLayerIdx( gopEntry.m_collocatedRefLayerIdx );748 }749 }750 751 #endif752 #else753 709 pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive,pcSlice->getRPS()->getNumberOfPictures())); 754 710 pcSlice->setNumRefIdx(REF_PIC_LIST_1,min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive,pcSlice->getRPS()->getNumberOfPictures())); … … 760 716 761 717 // Set reference list 762 #if H_MV5763 718 #if H_MV 764 719 pcSlice->setRefPicList( tempRefPicLists, usedAsLongTerm, numPocTotalCurr ); … … 782 737 } 783 738 } 784 #endif785 #else786 #if H_MV787 pcSlice->setRefPicList( rcListPic, m_refPicSetInterLayer );788 #if H_3D_ARP789 pcSlice->setARPStepNum();790 if(pcSlice->getARPStepNum() > 1)791 {792 for(Int iLayerId = 0; iLayerId < getLayerId(); iLayerId ++ )793 {794 Int iViewIdx = pcSlice->getVPS()->getViewIndex(iLayerId);795 Bool bIsDepth = ( pcSlice->getVPS()->getDepthId ( iLayerId ) == 1 );796 if( iViewIdx<getViewIndex() && !bIsDepth )797 {798 pcSlice->setBaseViewRefPicList( m_ivPicLists->getPicList( iLayerId ), iViewIdx );799 }800 }801 }802 #endif803 #else804 pcSlice->setRefPicList ( rcListPic );805 #endif806 739 #endif 807 740 #if H_3D … … 913 846 914 847 // SAIT_VSO_EST_A0033 848 #if H_3D_FCO 849 Bool flagRec; 850 flagRec = ((m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), false, pcSlice->getPOC(), true) == NULL) ? false: true); 851 pcRdCost->setVideoRecPicYuv( m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), false, pcSlice->getPOC(), flagRec ) ); 852 pcRdCost->setDepthPicYuv ( m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), true, pcSlice->getPOC(), false ) ); 853 #else 915 854 pcRdCost->setVideoRecPicYuv( m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), false , pcSlice->getPOC(), true ) ); 916 855 pcRdCost->setDepthPicYuv ( m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), true , pcSlice->getPOC(), false ) ); 856 #endif 917 857 918 858 // LGE_WVSO_A0119 … … 970 910 } 971 911 m_pcRateCtrl->initRCPic( frameLevel ); 912 913 #if KWU_RC_MADPRED_E0227 914 if(m_pcCfg->getLayerId() != 0) 915 { 916 m_pcRateCtrl->getRCPic()->setIVPic( m_pcEncTop->getEncTop()->getTEncTop(0)->getRateCtrl()->getRCPic() ); 917 } 918 #endif 919 972 920 estimatedBits = m_pcRateCtrl->getRCPic()->getTargetBits(); 973 921 … … 1014 962 else // normal case 1015 963 { 964 #if KWU_RC_MADPRED_E0227 965 if(m_pcRateCtrl->getLayerID() != 0) 966 { 967 list<TEncRCPic*> listPreviousPicture = m_pcRateCtrl->getPicList(); 968 lambda = m_pcRateCtrl->getRCPic()->estimatePicLambdaIV( listPreviousPicture, pcSlice->getPOC() ); 969 sliceQP = m_pcRateCtrl->getRCPic()->estimatePicQP( lambda, listPreviousPicture ); 970 } 971 else 972 { 973 #endif 1016 974 list<TEncRCPic*> listPreviousPicture = m_pcRateCtrl->getPicList(); 1017 975 #if RATE_CONTROL_INTRA … … 1021 979 #endif 1022 980 sliceQP = m_pcRateCtrl->getRCPic()->estimatePicQP( lambda, listPreviousPicture ); 981 #if KWU_RC_MADPRED_E0227 982 } 983 #endif 1023 984 } 1024 985 … … 1155 1116 pcPic->setNumDdvCandPics(pcPic->getDisCandRefPictures(iColPoc)); 1156 1117 } 1118 #endif 1157 1119 #if H_3D 1158 1120 pcSlice->setDepthToDisparityLUTs(); 1159 1121 1160 1122 #endif 1161 #endif 1162 #if MTK_NBDV_TN_FIX_E01721123 1124 #if H_3D_NBDV 1163 1125 if(pcSlice->getViewIndex() && !pcSlice->getIsDepth() && !pcSlice->isIntra()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done. 1164 1126 { 1165 1127 pcPic->checkTemporalIVRef(); 1166 1128 } 1167 #endif 1168 #if MTK_TEXTURE_MRGCAND_BUGFIX_E0182 1129 1169 1130 if(pcSlice->getIsDepth()) 1170 1131 { … … 1412 1373 } 1413 1374 } 1414 pictureTimingSEI.m_auCpbRemovalDelay = std::m ax<Int>(1, m_totalCoded - m_lastBPSEI); // Syntax element signalled as minus, hence the .1375 pictureTimingSEI.m_auCpbRemovalDelay = std::min<Int>(std::max<Int>(1, m_totalCoded - m_lastBPSEI), static_cast<Int>(pow(2, static_cast<double>(pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getCpbRemovalDelayLengthMinus1()+1)))); // Syntax element signalled as minus, hence the . 1415 1376 pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(0) + pcSlice->getPOC() - m_totalCoded; 1416 1377 Int factor = pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getTickDivisorMinus2() + 2; … … 1862 1823 pcPic->destroyNonDBFilterInfo(); 1863 1824 } 1864 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E01701825 #if H_3D 1865 1826 pcPic->compressMotion(2); 1866 1827 #endif … … 1898 1859 digestStr = digestToString(sei_recon_picture_digest.digest, 4); 1899 1860 } 1900 #if H_MV _FIX_LID_PIC_HASH_SEI_T401861 #if H_MV 1901 1862 OutputNALUnit nalu(NAL_UNIT_SUFFIX_SEI, pcSlice->getTLayer(), getLayerId() ); 1902 1863 #else … … 1940 1901 xCalculateAddPSNR( pcPic, pcPic->getPicYuvRec(), accessUnit, dEncTime ); 1941 1902 1903 //In case of field coding, compute the interlaced PSNR for both fields 1904 if (isField && ((!pcPic->isTopField() && isTff) || (pcPic->isTopField() && !isTff))) 1905 { 1906 //get complementary top field 1907 TComPic* pcPicTop; 1908 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 1909 while ((*iterPic)->getPOC() != pcPic->getPOC()-1) 1910 { 1911 iterPic ++; 1912 } 1913 pcPicTop = *(iterPic); 1914 xCalculateInterlacedAddPSNR(pcPicTop, pcPic, pcPicTop->getPicYuvRec(), pcPic->getPicYuvRec(), accessUnit, dEncTime ); 1915 } 1916 1942 1917 if (digestStr) 1943 1918 { … … 2072 2047 OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI, pcSlice->getTLayer()); 2073 2048 m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice); 2049 pictureTimingSEI.m_picStruct = (isField && pcSlice->getPic()->isTopField())? 1 : isField? 2 : 0; 2074 2050 m_seiWriter.writeSEImessage(nalu.m_Bitstream, pictureTimingSEI, pcSlice->getSPS()); 2075 2051 writeRBSPTrailingBits(nalu.m_Bitstream); … … 2166 2142 pcPic->setReconMark ( true ); 2167 2143 #if H_MV 2168 #if H_MV52169 2144 TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 2170 #else2171 TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer );2172 #endif2173 2145 std::vector<Int> temp; 2174 2146 TComSlice::markCurrPic( pcPic ); … … 2184 2156 delete[] pcSubstreamsOut; 2185 2157 } 2186 #if ! RATE_CONTROL_LAMBDA_DOMAIN2158 #if !KWU_FIX_URQ && !RATE_CONTROL_LAMBDA_DOMAIN 2187 2159 if(m_pcCfg->getUseRateCtrl()) 2188 2160 { … … 2196 2168 2197 2169 #if !H_MV 2198 assert ( m_iNumPicCoded == iNumPicRcvd);2170 assert ( (m_iNumPicCoded == iNumPicRcvd) || (isField && iPOCLast == 1) ); 2199 2171 #endif 2200 2172 } 2201 2173 2202 2174 #if !H_MV 2203 Void TEncGOP::printOutSummary(UInt uiNumAllPicCoded )2175 Void TEncGOP::printOutSummary(UInt uiNumAllPicCoded, bool isField) 2204 2176 { 2205 2177 assert (uiNumAllPicCoded == m_gcAnalyzeAll.getNumPic()); … … 2207 2179 2208 2180 //--CFG_KDY 2181 if(isField) 2182 { 2183 m_gcAnalyzeAll.setFrmRate( m_pcCfg->getFrameRate() * 2); 2184 m_gcAnalyzeI.setFrmRate( m_pcCfg->getFrameRate() * 2); 2185 m_gcAnalyzeP.setFrmRate( m_pcCfg->getFrameRate() * 2); 2186 m_gcAnalyzeB.setFrmRate( m_pcCfg->getFrameRate() * 2); 2187 } 2188 else 2189 { 2209 2190 m_gcAnalyzeAll.setFrmRate( m_pcCfg->getFrameRate() ); 2210 2191 m_gcAnalyzeI.setFrmRate( m_pcCfg->getFrameRate() ); 2211 2192 m_gcAnalyzeP.setFrmRate( m_pcCfg->getFrameRate() ); 2212 2193 m_gcAnalyzeB.setFrmRate( m_pcCfg->getFrameRate() ); 2194 } 2213 2195 2214 2196 //-- all … … 2233 2215 m_gcAnalyzeB.printSummary('B'); 2234 2216 #endif 2217 2218 if(isField) 2219 { 2220 //-- interlaced summary 2221 m_gcAnalyzeAll_in.setFrmRate( m_pcCfg->getFrameRate()); 2222 printf( "\n\nSUMMARY INTERLACED ---------------------------------------------\n" ); 2223 m_gcAnalyzeAll_in.printOutInterlaced('a', m_gcAnalyzeAll.getBits()); 2224 2225 #if _SUMMARY_OUT_ 2226 m_gcAnalyzeAll_in.printSummaryOutInterlaced(); 2227 #endif 2228 } 2235 2229 2236 2230 printf("\nRVM: %.3lf\n" , xCalculateRVM()); … … 2276 2270 // Protected member functions 2277 2271 // ==================================================================================================================== 2272 2273 2274 Void TEncGOP::xInitGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, bool isField ) 2275 { 2276 assert( iNumPicRcvd > 0 ); 2277 // Exception for the first frames 2278 if ( ( isField && (iPOCLast == 0 || iPOCLast == 1) ) || (!isField && (iPOCLast == 0)) ) 2279 { 2280 m_iGopSize = 1; 2281 } 2282 else 2283 { 2284 m_iGopSize = m_pcCfg->getGOPSize(); 2285 } 2286 assert (m_iGopSize > 0); 2287 2288 return; 2289 } 2278 2290 2279 2291 Void TEncGOP::xInitGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut ) … … 2299 2311 TComPic*& rpcPic, 2300 2312 TComPicYuv*& rpcPicYuvRecOut, 2301 Int pocCurr ) 2313 Int pocCurr, 2314 bool isField) 2302 2315 { 2303 2316 Int i; 2304 2317 // Rec. output 2305 2318 TComList<TComPicYuv*>::iterator iterPicYuvRec = rcListPicYuvRecOut.end(); 2306 for ( i = 0; i < iNumPicRcvd - iTimeOffset + 1; i++ ) 2319 2320 if (isField) 2321 { 2322 for ( i = 0; i < ( (pocCurr == 0 ) || (pocCurr == 1 ) ? (iNumPicRcvd - iTimeOffset + 1) : (iNumPicRcvd - iTimeOffset + 2) ); i++ ) 2323 { 2324 iterPicYuvRec--; 2325 } 2326 } 2327 else 2328 { 2329 for ( i = 0; i < (iNumPicRcvd - iTimeOffset + 1); i++ ) 2307 2330 { 2308 2331 iterPicYuvRec--; 2309 2332 } 2310 2333 2334 } 2335 2336 if (isField) 2337 { 2338 if(pocCurr == 1) 2339 { 2340 iterPicYuvRec++; 2341 } 2342 } 2311 2343 rpcPicYuvRecOut = *(iterPicYuvRec); 2312 2344 … … 2323 2355 iterPic++; 2324 2356 } 2325 2357 2358 #if !H_MV 2359 assert( rpcPic != NULL ); 2360 #endif 2326 2361 assert (rpcPic->getPOC() == pocCurr); 2327 2362 … … 2642 2677 } 2643 2678 2679 2680 Void reinterlace(Pel* top, Pel* bottom, Pel* dst, UInt stride, UInt width, UInt height, bool isTff) 2681 { 2682 2683 for (Int y = 0; y < height; y++) 2684 { 2685 for (Int x = 0; x < width; x++) 2686 { 2687 dst[x] = isTff ? (UChar) top[x] : (UChar) bottom[x]; 2688 dst[stride+x] = isTff ? (UChar) bottom[x] : (UChar) top[x]; 2689 } 2690 top += stride; 2691 bottom += stride; 2692 dst += stride*2; 2693 } 2694 } 2695 2696 2697 Void TEncGOP::xCalculateInterlacedAddPSNR( TComPic* pcPicOrgTop, TComPic* pcPicOrgBottom, TComPicYuv* pcPicRecTop, TComPicYuv* pcPicRecBottom, const AccessUnit& accessUnit, Double dEncTime ) 2698 { 2699 #if H_MV 2700 assert( 0 ); // Field coding and MV need to be aligned. 2701 #else 2702 Int x, y; 2703 2704 UInt64 uiSSDY_in = 0; 2705 UInt64 uiSSDU_in = 0; 2706 UInt64 uiSSDV_in = 0; 2707 2708 Double dYPSNR_in = 0.0; 2709 Double dUPSNR_in = 0.0; 2710 Double dVPSNR_in = 0.0; 2711 2712 /*------ INTERLACED PSNR -----------*/ 2713 2714 /* Luma */ 2715 2716 Pel* pOrgTop = pcPicOrgTop->getPicYuvOrg()->getLumaAddr(); 2717 Pel* pOrgBottom = pcPicOrgBottom->getPicYuvOrg()->getLumaAddr(); 2718 Pel* pRecTop = pcPicRecTop->getLumaAddr(); 2719 Pel* pRecBottom = pcPicRecBottom->getLumaAddr(); 2720 2721 Int iWidth; 2722 Int iHeight; 2723 Int iStride; 2724 2725 iWidth = pcPicOrgTop->getPicYuvOrg()->getWidth () - m_pcEncTop->getPad(0); 2726 iHeight = pcPicOrgTop->getPicYuvOrg()->getHeight() - m_pcEncTop->getPad(1); 2727 iStride = pcPicOrgTop->getPicYuvOrg()->getStride(); 2728 Int iSize = iWidth*iHeight; 2729 bool isTff = pcPicOrgTop->isTopField(); 2730 2731 TComPicYuv* pcOrgInterlaced = new TComPicYuv; 2732 pcOrgInterlaced->create( iWidth, iHeight << 1, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 2733 2734 TComPicYuv* pcRecInterlaced = new TComPicYuv; 2735 pcRecInterlaced->create( iWidth, iHeight << 1, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 2736 2737 Pel* pOrgInterlaced = pcOrgInterlaced->getLumaAddr(); 2738 Pel* pRecInterlaced = pcRecInterlaced->getLumaAddr(); 2739 2740 //=== Interlace fields ==== 2741 reinterlace(pOrgTop, pOrgBottom, pOrgInterlaced, iStride, iWidth, iHeight, isTff); 2742 reinterlace(pRecTop, pRecBottom, pRecInterlaced, iStride, iWidth, iHeight, isTff); 2743 2744 //===== calculate PSNR ===== 2745 for( y = 0; y < iHeight << 1; y++ ) 2746 { 2747 for( x = 0; x < iWidth; x++ ) 2748 { 2749 Int iDiff = (Int)( pOrgInterlaced[x] - pRecInterlaced[x] ); 2750 uiSSDY_in += iDiff * iDiff; 2751 } 2752 pOrgInterlaced += iStride; 2753 pRecInterlaced += iStride; 2754 } 2755 2756 /*Chroma*/ 2757 2758 iHeight >>= 1; 2759 iWidth >>= 1; 2760 iStride >>= 1; 2761 2762 pOrgTop = pcPicOrgTop->getPicYuvOrg()->getCbAddr(); 2763 pOrgBottom = pcPicOrgBottom->getPicYuvOrg()->getCbAddr(); 2764 pRecTop = pcPicRecTop->getCbAddr(); 2765 pRecBottom = pcPicRecBottom->getCbAddr(); 2766 pOrgInterlaced = pcOrgInterlaced->getCbAddr(); 2767 pRecInterlaced = pcRecInterlaced->getCbAddr(); 2768 2769 //=== Interlace fields ==== 2770 reinterlace(pOrgTop, pOrgBottom, pOrgInterlaced, iStride, iWidth, iHeight, isTff); 2771 reinterlace(pRecTop, pRecBottom, pRecInterlaced, iStride, iWidth, iHeight, isTff); 2772 2773 //===== calculate PSNR ===== 2774 for( y = 0; y < iHeight << 1; y++ ) 2775 { 2776 for( x = 0; x < iWidth; x++ ) 2777 { 2778 Int iDiff = (Int)( pOrgInterlaced[x] - pRecInterlaced[x] ); 2779 uiSSDU_in += iDiff * iDiff; 2780 } 2781 pOrgInterlaced += iStride; 2782 pRecInterlaced += iStride; 2783 } 2784 2785 pOrgTop = pcPicOrgTop->getPicYuvOrg()->getCrAddr(); 2786 pOrgBottom = pcPicOrgBottom->getPicYuvOrg()->getCrAddr(); 2787 pRecTop = pcPicRecTop->getCrAddr(); 2788 pRecBottom = pcPicRecBottom->getCrAddr(); 2789 pOrgInterlaced = pcOrgInterlaced->getCrAddr(); 2790 pRecInterlaced = pcRecInterlaced->getCrAddr(); 2791 2792 //=== Interlace fields ==== 2793 reinterlace(pOrgTop, pOrgBottom, pOrgInterlaced, iStride, iWidth, iHeight, isTff); 2794 reinterlace(pRecTop, pRecBottom, pRecInterlaced, iStride, iWidth, iHeight, isTff); 2795 2796 //===== calculate PSNR ===== 2797 for( y = 0; y < iHeight << 1; y++ ) 2798 { 2799 for( x = 0; x < iWidth; x++ ) 2800 { 2801 Int iDiff = (Int)( pOrgInterlaced[x] - pRecInterlaced[x] ); 2802 uiSSDV_in += iDiff * iDiff; 2803 } 2804 pOrgInterlaced += iStride; 2805 pRecInterlaced += iStride; 2806 } 2807 2808 Int maxvalY = 255 << (g_bitDepthY-8); 2809 Int maxvalC = 255 << (g_bitDepthC-8); 2810 Double fRefValueY = (Double) maxvalY * maxvalY * iSize*2; 2811 Double fRefValueC = (Double) maxvalC * maxvalC * iSize*2 / 4.0; 2812 dYPSNR_in = ( uiSSDY_in ? 10.0 * log10( fRefValueY / (Double)uiSSDY_in ) : 99.99 ); 2813 dUPSNR_in = ( uiSSDU_in ? 10.0 * log10( fRefValueC / (Double)uiSSDU_in ) : 99.99 ); 2814 dVPSNR_in = ( uiSSDV_in ? 10.0 * log10( fRefValueC / (Double)uiSSDV_in ) : 99.99 ); 2815 2816 /* calculate the size of the access unit, excluding: 2817 * - any AnnexB contributions (start_code_prefix, zero_byte, etc.,) 2818 * - SEI NAL units 2819 */ 2820 UInt numRBSPBytes = 0; 2821 for (AccessUnit::const_iterator it = accessUnit.begin(); it != accessUnit.end(); it++) 2822 { 2823 UInt numRBSPBytes_nal = UInt((*it)->m_nalUnitData.str().size()); 2824 2825 if ((*it)->m_nalUnitType != NAL_UNIT_PREFIX_SEI && (*it)->m_nalUnitType != NAL_UNIT_SUFFIX_SEI) 2826 numRBSPBytes += numRBSPBytes_nal; 2827 } 2828 2829 UInt uibits = numRBSPBytes * 8 ; 2830 2831 //===== add PSNR ===== 2832 m_gcAnalyzeAll_in.addResult (dYPSNR_in, dUPSNR_in, dVPSNR_in, (Double)uibits); 2833 2834 printf("\n Interlaced frame %d: [Y %6.4lf dB U %6.4lf dB V %6.4lf dB]", pcPicOrgBottom->getPOC()/2 , dYPSNR_in, dUPSNR_in, dVPSNR_in ); 2835 2836 pcOrgInterlaced->destroy(); 2837 delete pcOrgInterlaced; 2838 pcRecInterlaced->destroy(); 2839 delete pcRecInterlaced; 2840 #endif 2841 } 2644 2842 /** Function for deciding the nal_unit_type. 2645 2843 * \param pocCurr POC of the current picture … … 3002 3200 3003 3201 #if H_MV 3004 #if H_MV53005 3202 Void TEncGOP::xSetRefPicListModificationsMv( std::vector<TComPic*> tempPicLists[2], TComSlice* pcSlice, UInt iGOPid ) 3006 3203 { … … 3086 3283 } 3087 3284 } 3088 #else3089 Void TEncGOP::xSetRefPicListModificationsMv( TComSlice* pcSlice, UInt iGOPid )3090 {3091 Int layer = pcSlice->getLayerIdInVps( );3092 3093 if( pcSlice->getSliceType() == I_SLICE || !(pcSlice->getPPS()->getListsModificationPresentFlag()) || pcSlice->getNumActiveRefLayerPics() == 0 )3094 {3095 return;3096 }3097 3098 // analyze inter-view modifications3099 GOPEntry ge = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && ( layer > 0) ) ? MAX_GOP : iGOPid );3100 assert( ge.m_numActiveRefLayerPics == pcSlice->getNumActiveRefLayerPics() );3101 3102 Int maxRefListSize = pcSlice->getNumRpsCurrTempList();3103 Int numTemporalRefs = maxRefListSize - pcSlice->getNumActiveRefLayerPics();3104 3105 for (Int li = 0; li < 2; li ++) // Loop over lists L0 and L13106 {3107 // set inter-view modifications3108 Int tempList[16];3109 for( Int k = 0; k < 16; k++ )3110 {3111 tempList[ k ] = -1;3112 }3113 3114 Bool isModified = false;3115 if ( maxRefListSize > 1 )3116 {3117 for( Int k = 0, orgIdx = numTemporalRefs; k < ge.m_numActiveRefLayerPics; k++, orgIdx++ )3118 {3119 Int targetIdx = ge.m_interViewRefPosL[ li ][ k ];3120 3121 isModified = ( targetIdx != orgIdx ) && ( targetIdx >= 0 );3122 if ( isModified )3123 {3124 assert( tempList[ targetIdx ] == -1 ); // Assert when two inter layer reference pictures are sorted to the same position3125 tempList[ targetIdx ] = orgIdx;3126 }3127 }3128 }3129 3130 TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification();3131 refPicListModification->setRefPicListModificationFlagL( li, isModified );3132 3133 if( isModified )3134 {3135 Int temporalRefIdx = 0;3136 for( Int i = 0; i < pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 ); i++ )3137 {3138 if( tempList[i] >= 0 )3139 {3140 refPicListModification->setRefPicSetIdxL( li, i, tempList[i] );3141 }3142 else3143 {3144 refPicListModification->setRefPicSetIdxL( li, i, temporalRefIdx );3145 temporalRefIdx++;3146 }3147 }3148 }3149 }3150 }3151 #endif3152 3285 #endif 3153 3286 //! \} -
TabularUnified trunk/source/Lib/TLibEncoder/TEncGOP.h ¶
r622 r655 57 57 #include "TEncAnalyze.h" 58 58 #include "TEncRateCtrl.h" 59 #if KWU_RC_MADPRED_E0227 60 #include "../App/TAppEncoder/TAppEncTop.h" 61 #endif 59 62 #include <vector> 60 63 … … 99 102 #if H_MV 100 103 TComPicLists* m_ivPicLists; 101 #if H_MV5102 104 std::vector<TComPic*> m_refPicSetInterLayer0; 103 105 std::vector<TComPic*> m_refPicSetInterLayer1; 104 #else105 std::vector<TComPic*> m_refPicSetInterLayer;106 #endif107 106 108 107 Int m_pocLastCoded; … … 148 147 #if H_MV 149 148 Void initGOP ( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP); 150 Void compressPicInGOP ( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP, Int iGOPid );149 Void compressPicInGOP ( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP, Int iGOPid, Bool isField, Bool isTff ); 151 150 #else 152 Void compressGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRec, std::list<AccessUnit>& accessUnitsInGOP );151 Void compressGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRec, std::list<AccessUnit>& accessUnitsInGOP, Bool isField, Bool isTff ); 153 152 #endif 154 153 Void xAttachSliceDataToNalUnit (OutputNALUnit& rNalu, TComOutputBitstream*& rpcBitstreamRedirect); … … 169 168 170 169 #if !H_MV 171 Void printOutSummary ( UInt uiNumAllPicCoded );170 Void printOutSummary ( UInt uiNumAllPicCoded , bool isField); 172 171 #endif 173 172 #if H_3D_VSO … … 176 175 Void preLoopFilterPicAll ( TComPic* pcPic, UInt64& ruiDist, UInt64& ruiBits ); 177 176 #endif 178 177 178 #if KWU_RC_MADPRED_E0227 179 TEncTop* getEncTop() { return m_pcEncTop; } 180 #endif 181 179 182 TEncSlice* getSliceEncoder() { return m_pcSliceEncoder; } 180 183 NalUnitType getNalUnitType( Int pocCurr, Int lastIdr ); … … 184 187 185 188 protected: 189 Void xInitGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, bool isField ); 190 186 191 Void xInitGOP ( Int iPOC, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut ); 187 Void xGetBuffer ( TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, Int iNumPicRcvd, Int iTimeOffset, TComPic*& rpcPic, TComPicYuv*& rpcPicYuvRecOut, Int pocCurr );192 Void xGetBuffer ( TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, Int iNumPicRcvd, Int iTimeOffset, TComPic*& rpcPic, TComPicYuv*& rpcPicYuvRecOut, Int pocCurr, bool isField ); 188 193 189 194 Void xCalculateAddPSNR ( TComPic* pcPic, TComPicYuv* pcPicD, const AccessUnit&, Double dEncTime ); 195 Void xCalculateInterlacedAddPSNR( TComPic* pcPicOrgTop, TComPic* pcPicOrgBottom, TComPicYuv* pcPicRecTop, TComPicYuv* pcPicRecBottom, const AccessUnit& accessUnit, Double dEncTime ); 196 190 197 #if H_3D_VSO 191 198 Dist64 xFindDistortionFrame (TComPicYuv* pcPic0, TComPicYuv* pcPic1); … … 216 223 } 217 224 #if H_MV 218 #if H_MV5219 225 Void xSetRefPicListModificationsMv( std::vector<TComPic*> tempPicLists[2], TComSlice* pcSlice, UInt iGOPid ); 220 #else221 Void xSetRefPicListModificationsMv( TComSlice* pcSlice, UInt iGOPid );222 #endif223 226 #endif 224 227 Void dblMetric( TComPic* pcPic, UInt uiNumSlices ); -
TabularUnified trunk/source/Lib/TLibEncoder/TEncRateCtrl.cpp ¶
r608 r655 537 537 m_lastPicture = NULL; 538 538 #endif 539 540 #if KWU_RC_MADPRED_E0227 541 m_lastIVPicture = NULL; 542 #endif 543 539 544 m_picActualHeaderBits = 0; 540 545 #if !M0036_RC_IMPROVEMENT … … 544 549 m_picQP = 0; 545 550 m_picLambda = 0.0; 551 552 #if KWU_RC_MADPRED_E0227 553 m_IVtotalMAD = 0.0; 554 #endif 546 555 } 547 556 … … 621 630 } 622 631 632 #if KWU_RC_MADPRED_E0227 633 Void TEncRCPic::addToPictureLsitIV( list<TEncRCPic*>& listPreviousPictures ) 634 { 635 m_lastIVPicture = NULL; 636 m_lastIVPicture = this; 637 } 638 639 Void TEncRCPic::setIVPic( TEncRCPic* BaseRCPic ) 640 { 641 m_lastIVPicture = BaseRCPic; 642 } 643 #endif 644 645 #if KWU_RC_MADPRED_E0227 646 Void TEncRCPic::create( TEncRCSeq* encRCSeq, TEncRCGOP* encRCGOP, Int frameLevel, list<TEncRCPic*>& listPreviousPictures, Int layerID ) 647 #else 623 648 Void TEncRCPic::create( TEncRCSeq* encRCSeq, TEncRCGOP* encRCGOP, Int frameLevel, list<TEncRCPic*>& listPreviousPictures ) 649 #endif 624 650 { 625 651 destroy(); … … 673 699 Int currHeight = ( (j == picHeightInLCU-1) ? picHeight - LCUHeight*(picHeightInLCU-1) : LCUHeight ); 674 700 m_LCUs[LCUIdx].m_numberOfPixel = currWidth * currHeight; 701 702 #if KWU_RC_MADPRED_E0227 703 m_LCUs[LCUIdx].m_CUWidth = currWidth; 704 m_LCUs[LCUIdx].m_CUHeight = currHeight; 705 m_LCUs[LCUIdx].m_IVMAD = -1.0; 706 #endif 675 707 } 676 708 } … … 683 715 m_picLambda = 0.0; 684 716 717 718 #if KWU_RC_MADPRED_E0227 719 m_LayerID = layerID; 720 m_lastIVPicture = NULL; 721 m_IVtotalMAD = 0.0; 722 #endif 723 724 685 725 #if !M0036_RC_IMPROVEMENT 686 726 m_lastPicture = NULL; 687 727 list<TEncRCPic*>::reverse_iterator it; 728 for ( it = listPreviousPictures.rbegin(); it != listPreviousPictures.rend(); it++ ) 729 { 730 if ( (*it)->getFrameLevel() == m_frameLevel ) 731 { 732 m_lastPicture = (*it); 733 break; 734 } 735 } 736 #endif 737 738 #if KWU_RC_MADPRED_E0227 739 list<TEncRCPic*>::reverse_iterator it; 740 if( m_LayerID != 0) 741 { 742 m_lastIVPicture = NULL; 743 for ( it = listPreviousPictures.rbegin(); it != listPreviousPictures.rend(); it++ ) 744 { 745 if ( (*it)->getLayerID() == 0 ) 746 { 747 m_lastIVPicture = (*it); 748 break; 749 } 750 } 751 } 752 753 m_lastPicture = NULL; 688 754 for ( it = listPreviousPictures.rbegin(); it != listPreviousPictures.rend(); it++ ) 689 755 { … … 856 922 } 857 923 924 925 #if KWU_RC_MADPRED_E0227 926 Double TEncRCPic::estimatePicLambdaIV( list<TEncRCPic*>& listPreviousPictures, Int CurPOC ) 927 { 928 Double alpha = m_encRCSeq->getPicPara( m_frameLevel ).m_alpha; 929 Double beta = m_encRCSeq->getPicPara( m_frameLevel ).m_beta; 930 Double bpp = (Double)m_targetBits/(Double)m_numberOfPixel; 931 Double estLambda = alpha * pow( bpp, beta ); 932 Double lastLevelLambda = -1.0; 933 Double lastPicLambda = -1.0; 934 Double lastValidLambda = -1.0; 935 list<TEncRCPic*>::iterator it; 936 937 if(listPreviousPictures.size() == 0 || CurPOC%8 == 0) 938 { 939 lastLevelLambda = m_lastIVPicture->getPicActualLambda(); 940 lastPicLambda = m_lastIVPicture->getPicActualLambda(); 941 } 942 else 943 { 944 for ( it = listPreviousPictures.begin(); it != listPreviousPictures.end(); it++ ) 945 { 946 if ( (*it)->getFrameLevel() == m_frameLevel ) 947 { 948 lastLevelLambda = (*it)->getPicActualLambda(); 949 } 950 lastPicLambda = (*it)->getPicActualLambda(); 951 952 if ( lastPicLambda > 0.0 ) 953 { 954 lastValidLambda = lastPicLambda; 955 } 956 } 957 } 958 959 if ( lastLevelLambda > 0.0 ) 960 { 961 lastLevelLambda = Clip3( 0.1, 10000.0, lastLevelLambda ); 962 estLambda = Clip3( lastLevelLambda * pow( 2.0, -3.0/3.0 ), lastLevelLambda * pow( 2.0, 3.0/3.0 ), estLambda ); 963 } 964 965 if ( lastPicLambda > 0.0 ) 966 { 967 lastPicLambda = Clip3( 0.1, 2000.0, lastPicLambda ); 968 estLambda = Clip3( lastPicLambda * pow( 2.0, -10.0/3.0 ), lastPicLambda * pow( 2.0, 10.0/3.0 ), estLambda ); 969 } 970 else if ( lastValidLambda > 0.0 ) 971 { 972 lastValidLambda = Clip3( 0.1, 2000.0, lastValidLambda ); 973 estLambda = Clip3( lastValidLambda * pow(2.0, -10.0/3.0), lastValidLambda * pow(2.0, 10.0/3.0), estLambda ); 974 } 975 else 976 { 977 estLambda = Clip3( 0.1, 10000.0, estLambda ); 978 } 979 980 if ( estLambda < 0.1 ) 981 { 982 estLambda = 0.1; 983 } 984 985 m_estPicLambda = estLambda; 986 return estLambda; 987 } 988 #endif 989 990 858 991 #if RATE_CONTROL_INTRA 859 992 Double TEncRCPic::getLCUTargetBpp(SliceType eSliceType) … … 937 1070 } 938 1071 1072 1073 #if KWU_RC_MADPRED_E0227 1074 Double TEncRCPic::getLCUTargetBppforInterView( list<TEncRCPic*>& listPreviousPictures, TComDataCU* pcCU, Double basePos, Double curPos, Double focalLen, Double znear, Double zfar, Int direction, Int* disparity ) 1075 { 1076 Int LCUIdx = getLCUCoded(); 1077 Double bpp = -1.0; 1078 Int avgBits = 0; 1079 #if !M0036_RC_IMPROVEMENT 1080 Double totalMAD = -1.0; 1081 Double MAD = -1.0; 1082 #endif 1083 1084 Double totalMAD = -1.0; 1085 Double MAD = -1.0; 1086 1087 Double IVMAD = -1.0; 1088 Double SAD = 0.0; 1089 Int x, y; 1090 Int Sum = 0; 1091 1092 { 1093 Pel* pOrg = pcCU->getSlice()->getIvPic(false, 0)->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0); 1094 Pel* pRec = pcCU->getSlice()->getIvPic(false, 0)->getPicYuvRec()->getLumaAddr(pcCU->getAddr(), 0); 1095 Pel* pDep = pcCU->getSlice()->getIvPic(true, pcCU->getSlice()->getViewIndex())->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0); 1096 Int iStride = pcCU->getSlice()->getIvPic(true, pcCU->getSlice()->getViewIndex())->getPicYuvOrg()->getStride(); 1097 1098 Int width = m_LCUs[ LCUIdx ].m_CUWidth; 1099 Int height = m_LCUs[ LCUIdx ].m_CUHeight; 1100 1101 for( y = 0 ; y < pcCU->getSlice()->getSPS()->getMaxCUHeight() ; y+=8) 1102 { 1103 for( x = 0 ; x < pcCU->getSlice()->getSPS()->getMaxCUWidth() ; x+=8) 1104 { 1105 Sum += pDep[x]; 1106 } 1107 pDep += iStride; 1108 } 1109 1110 Double AvgDepth = (Double)Sum/((pcCU->getSlice()->getSPS()->getMaxCUHeight()/8)*(pcCU->getSlice()->getSPS()->getMaxCUWidth()/8)); 1111 1112 Double fL = focalLen * abs( basePos - curPos ); 1113 Double z = abs( 1.0 / znear - 1.0 / zfar ) * ((Double)(AvgDepth) / (( 1 << g_bitDepthY ) - 1) ) + abs(1.0 / zfar); 1114 *disparity = (Int)(direction*fL * z); 1115 Int shift = DISTORTION_PRECISION_ADJUSTMENT(g_bitDepthY-8); 1116 1117 Int disp = *disparity; 1118 Int posX, posY; 1119 pcCU->getPosInPic(0, posX, posY); 1120 if((posX + *disparity) < 0 || (posX + *disparity + width) >= pcCU->getSlice()->getSPS()->getMaxCUWidth()) 1121 { 1122 disp = 0; 1123 } 1124 1125 for( y = 0; y < height; y++ ) 1126 { 1127 for( x = 0; x < width; x++ ) 1128 { 1129 SAD += abs( pOrg[Clip3(0, (Int)(pcCU->getPic()->getPicYuvOrg()->getWidth() - pcCU->getSlice()->getSPS()->getMaxCUWidth()), x + disp)] 1130 - pRec[Clip3(0, (Int)(pcCU->getPic()->getPicYuvOrg()->getWidth() - pcCU->getSlice()->getSPS()->getMaxCUWidth()), x + disp)] )>>shift; 1131 } 1132 pOrg += iStride; 1133 pRec += iStride; 1134 } 1135 IVMAD = SAD / (Double)(height * width); 1136 IVMAD = IVMAD * IVMAD; 1137 1138 m_LCUs[ LCUIdx ].m_IVMAD = IVMAD; 1139 if(m_lastPicture) 1140 { 1141 m_LCUs[ LCUIdx ].m_MAD = m_lastPicture->getLCU(LCUIdx).m_MAD; 1142 } 1143 1144 MAD = m_LCUs[ LCUIdx ].m_IVMAD; 1145 1146 if(m_lastPicture) 1147 { 1148 totalMAD = m_lastPicture->getTotalMAD(); // get total MAD of temporal frame 1149 for ( Int i=0; i<LCUIdx; i++ ) 1150 { 1151 totalMAD -= m_lastPicture->getLCU(i).m_MAD; 1152 } 1153 } 1154 else 1155 { 1156 totalMAD = m_lastIVPicture->getTotalMAD(); // get total MAD of inter-view frame 1157 for ( Int i=0; i<LCUIdx; i++ ) 1158 { 1159 totalMAD -= m_lastIVPicture->getLCU(i).m_MAD; 1160 } 1161 } 1162 1163 1164 if ( totalMAD > 0.1 ) 1165 { 1166 avgBits = Int( (m_bitsLeft * MAD) / totalMAD ); 1167 } 1168 else 1169 { 1170 avgBits = Int( (m_bitsLeft) / m_LCULeft ); 1171 } 1172 } 1173 1174 if ( avgBits < 5 ) 1175 { 1176 avgBits = 5; 1177 } 1178 1179 bpp = ( Double )avgBits/( Double )m_LCUs[ LCUIdx ].m_numberOfPixel; 1180 m_LCUs[ LCUIdx ].m_targetBits = avgBits; 1181 1182 return bpp; 1183 } 1184 #endif 1185 1186 1187 1188 939 1189 Double TEncRCPic::getLCUEstLambda( Double bpp ) 940 1190 { … … 1185 1435 } 1186 1436 m_picLambda = averageLambda; 1187 #if !M0036_RC_IMPROVEMENT 1437 #if !M0036_RC_IMPROVEMENT || KWU_RC_MADPRED_E0227 1438 #if KWU_RC_MADPRED_E0227 1439 m_totalMAD = 0; 1440 #endif 1188 1441 for ( Int i=0; i<m_numberOfLCU; i++ ) 1189 1442 { … … 1393 1646 1394 1647 #if M0036_RC_IMPROVEMENT 1648 #if KWU_RC_MADPRED_E0227 1649 Void TEncRateCtrl::init( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Bool keepHierBits, Bool useLCUSeparateModel, GOPEntry GOPList[MAX_GOP], Int layerID ) 1650 #else 1395 1651 Void TEncRateCtrl::init( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Int keepHierBits, Bool useLCUSeparateModel, GOPEntry GOPList[MAX_GOP] ) 1652 #endif 1396 1653 #else 1397 1654 Void TEncRateCtrl::init( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Bool keepHierBits, Bool useLCUSeparateModel, GOPEntry GOPList[MAX_GOP] ) … … 1607 1864 } 1608 1865 1866 #if KWU_RC_MADPRED_E0227 1867 setLayerID(layerID); 1868 #endif 1869 1609 1870 delete[] bitsRatio; 1610 1871 delete[] GOPID2Level; … … 1614 1875 { 1615 1876 m_encRCPic = new TEncRCPic; 1877 #if KWU_RC_MADPRED_E0227 1878 m_encRCPic->create( m_encRCSeq, m_encRCGOP, frameLevel, m_listRCPictures, m_LayerID ); 1879 #else 1616 1880 m_encRCPic->create( m_encRCSeq, m_encRCGOP, frameLevel, m_listRCPictures ); 1881 #endif 1617 1882 } 1618 1883 … … 1815 2080 m_sourceHeightInLCU = (sourceHeight / maxCUHeight) + (( sourceHeight % maxCUHeight) ? 1 : 0); 1816 2081 m_isLowdelay = (sizeIntraPeriod == -1) ? true : false; 2082 1817 2083 m_prevBitrate = ( targetKbps << 10 ); // in units of 1,024 bps 1818 2084 m_currBitrate = ( targetKbps << 10 ); 2085 1819 2086 m_frameRate = frameRate; 1820 2087 m_refFrameNum = m_isLowdelay ? (sizeGOP) : (sizeGOP>>1); … … 2212 2479 } 2213 2480 2481 2482 #if KWU_RC_MADPRED_E0227 2483 Void TEncRateCtrl::updateLCUDataEnhancedView(TComDataCU* pcCU, UInt64 uiBits, Int qp, Double basePos, Double curPos, Double focalLen, Double znear, Double zfar, Int direction) 2484 { 2485 Int x, y; 2486 Double dMAD = 0.0; 2487 Int Sum = 0; 2488 Double SAD = 0.0; 2489 2490 Pel* pOrg = pcCU->getSlice()->getIvPic(false, 0)->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0); 2491 Pel* pRec = pcCU->getSlice()->getIvPic(false, 0)->getPicYuvRec()->getLumaAddr(pcCU->getAddr(), 0); 2492 Pel* pDep = pcCU->getSlice()->getIvPic(true, pcCU->getSlice()->getViewIndex())->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0); 2493 Int iStride = pcCU->getSlice()->getIvPic(true, pcCU->getSlice()->getViewIndex())->getPicYuvOrg()->getStride(); 2494 2495 Int width = m_pcLCUData[m_indexLCU].m_widthInPixel; 2496 Int height = m_pcLCUData[m_indexLCU].m_heightInPixel; 2497 2498 for( y = 0 ; y < pcCU->getSlice()->getSPS()->getMaxCUHeight() ; y+=8) 2499 { 2500 for( x = 0 ; x < pcCU->getSlice()->getSPS()->getMaxCUWidth() ; x+=8) 2501 { 2502 Sum += pDep[x]; 2503 } 2504 pDep += iStride; 2505 } 2506 2507 Double AvgDepth = (Double)Sum/((pcCU->getSlice()->getSPS()->getMaxCUHeight()/8)*(pcCU->getSlice()->getSPS()->getMaxCUWidth()/8)); 2508 Double fL = focalLen * abs( basePos - curPos ); 2509 Double z = abs( 1.0 / znear - 1.0 / zfar ) * ((Double)(AvgDepth) / (( 1 << g_bitDepthY ) - 1) ) + abs(1.0 / zfar); 2510 Int disparity = (Int)(direction*fL * z); 2511 Int shift = DISTORTION_PRECISION_ADJUSTMENT(g_bitDepthY-8); 2512 Int disp = disparity; 2513 2514 for( y = 0; y < height; y++ ) 2515 { 2516 for( x = 0; x < width; x++ ) 2517 { 2518 SAD += abs( pOrg[Clip3(0, (Int)(pcCU->getPic()->getPicYuvOrg()->getWidth() - pcCU->getSlice()->getSPS()->getMaxCUWidth()), x + disp)] 2519 - pRec[Clip3(0, (Int)(pcCU->getPic()->getPicYuvOrg()->getWidth() - pcCU->getSlice()->getSPS()->getMaxCUWidth()), x + disp)] )>>shift; 2520 } 2521 pOrg += iStride; 2522 pRec += iStride; 2523 } 2524 m_pcLCUData[m_indexLCU].m_qp = qp; 2525 m_pcLCUData[m_indexLCU].m_costMAD = (SAD /(Double)(width*height)); 2526 m_pcLCUData[m_indexLCU].m_bits = (Int)uiBits; 2527 } 2528 #endif 2529 2530 2214 2531 Double TEncRateCtrl::xAdjustmentBits(Int& reductionBits, Int& compensationBits) 2215 2532 { -
TabularUnified trunk/source/Lib/TLibEncoder/TEncRateCtrl.h ¶
r608 r655 98 98 Int m_targetBitsLeft; 99 99 #endif 100 101 #if KWU_RC_MADPRED_E0227 102 Double m_MAD; 103 104 Int m_CUWidth; 105 Int m_CUHeight; 106 Double m_IVMAD; 107 #endif 100 108 }; 101 109 … … 248 256 249 257 public: 258 #if KWU_RC_MADPRED_E0227 259 Void create( TEncRCSeq* encRCSeq, TEncRCGOP* encRCGOP, Int frameLevel, list<TEncRCPic*>& listPreviousPictures, Int layerID ); 260 #else 250 261 Void create( TEncRCSeq* encRCSeq, TEncRCGOP* encRCGOP, Int frameLevel, list<TEncRCPic*>& listPreviousPictures ); 262 #endif 251 263 Void destroy(); 252 264 265 #if KWU_RC_MADPRED_E0227 266 Double estimatePicLambdaIV( list<TEncRCPic*>& listPreviousPictures, Int curPOC ); 267 #endif 253 268 #if !RATE_CONTROL_INTRA 254 269 Double estimatePicLambda( list<TEncRCPic*>& listPreviousPictures ); … … 267 282 Double getLCUTargetBpp(); 268 283 #endif 284 285 #if KWU_RC_MADPRED_E0227 286 Double getLCUTargetBppforInterView( list<TEncRCPic*>& listPreviousPictures, TComDataCU* pcCU, Double basePos, Double curPos, Double focalLen, Double znear, Double zfar, Int direction, Int* disparity ); 287 #endif 288 269 289 Double getLCUEstLambda( Double bpp ); 270 290 Int getLCUEstQP( Double lambda, Int clipPicQP ); … … 282 302 283 303 Void addToPictureLsit( list<TEncRCPic*>& listPreviousPictures ); 304 305 #if KWU_RC_MADPRED_E0227 306 Void addToPictureLsitIV( list<TEncRCPic*>& listPreviousPictures ); 307 Void setIVPic( TEncRCPic* baseRCPic ); 308 #endif 309 284 310 #if !M0036_RC_IMPROVEMENT 285 311 Double getEffectivePercentage(); … … 322 348 #endif 323 349 350 #if KWU_RC_MADPRED_E0227 351 Double getTotalMAD() { return m_totalMAD; } 352 Void setTotalMAD( Double MAD ) { m_totalMAD = MAD; } 353 354 Double getIVTotalMAD() { return m_IVtotalMAD; } 355 Void setIVTotalMAD( Double MAD ) { m_IVtotalMAD = MAD; } 356 #endif 357 324 358 Int getPicActualBits() { return m_picActualBits; } 325 359 Int getPicActualQP() { return m_picQP; } … … 330 364 Void setPicEstLambda( Double lambda ) { m_picLambda = lambda; } 331 365 366 #if KWU_RC_MADPRED_E0227 367 Int getLayerID() { return m_LayerID; } 368 Void setLayerID(Int layerid) { m_LayerID = layerid; } 369 #endif 370 332 371 private: 333 372 TEncRCSeq* m_encRCSeq; … … 361 400 TEncRCPic* m_lastPicture; 362 401 #endif 402 403 #if KWU_RC_MADPRED_E0227 404 Double m_totalMAD; 405 TEncRCPic* m_lastPicture; 406 Int m_LayerID; 407 TEncRCPic* m_lastIVPicture; 408 Double m_IVtotalMAD; 409 #endif 363 410 }; 364 411 … … 371 418 public: 372 419 #if M0036_RC_IMPROVEMENT 420 #if KWU_RC_MADPRED_E0227 421 Void init( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Bool keepHierBits, Bool useLCUSeparateModel, GOPEntry GOPList[MAX_GOP], Int layerID ); 422 #else 373 423 Void init( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Int keepHierBits, Bool useLCUSeparateModel, GOPEntry GOPList[MAX_GOP] ); 424 #endif 374 425 #else 375 426 Void init( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Bool keepHierBits, Bool useLCUSeparateModel, GOPEntry GOPList[MAX_GOP] ); … … 388 439 list<TEncRCPic*>& getPicList() { return m_listRCPictures; } 389 440 441 #if KWU_RC_MADPRED_E0227 442 Int getLayerID() { return m_LayerID; } 443 Void setLayerID(Int layerid) { m_LayerID = layerid; } 444 #endif 445 390 446 private: 391 447 TEncRCSeq* m_encRCSeq; … … 394 450 list<TEncRCPic*> m_listRCPictures; 395 451 Int m_RCQP; 452 453 #if KWU_RC_MADPRED_E0227 454 Int m_LayerID; 455 #endif 396 456 }; 397 457 … … 518 578 Void updataRCUnitStatus (); 519 579 Void updateLCUData (TComDataCU* pcCU, UInt64 actualLCUBits, Int qp); 580 #if KWU_RC_MADPRED_E0227 581 Void updateLCUDataEnhancedView(TComDataCU* pcCU, UInt64 uiBits, Int qp, Double basePos, Double curPos, Double focalLen, Double znear, Double zfar, Int direction); 582 #endif 520 583 Void updateFrameData (UInt64 actualFrameBits); 521 584 Double xAdjustmentBits (Int& reductionBits, Int& compensationBits); -
TabularUnified trunk/source/Lib/TLibEncoder/TEncSbac.cpp ¶
r622 r655 95 95 #if H_3D_DIM_DMM 96 96 , m_cDmm1DataSCModel ( 1, 1, NUM_DMM1_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 97 #if !SEC_DMM2_E0146_HHIFIX98 , m_cDmm2DataSCModel ( 1, 1, NUM_DMM2_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels)99 #endif100 97 , m_cDmm3DataSCModel ( 1, 1, NUM_DMM3_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 101 98 #endif … … 108 105 #endif 109 106 #endif 110 #if LGE_INTER_SDC_E0156107 #if H_3D_INTER_SDC 111 108 , m_cInterSDCFlagSCModel ( 1, 1, NUM_INTER_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 112 109 , m_cInterSDCResidualSCModel ( 1, 1, NUM_INTER_SDC_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 177 174 #if H_3D_DIM_DMM 178 175 m_cDmm1DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA ); 179 #if !SEC_DMM2_E0146_HHIFIX180 m_cDmm2DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM2_DATA );181 #endif182 176 m_cDmm3DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM3_DATA ); 183 177 #endif … … 190 184 #endif 191 185 #endif 192 #if LGE_INTER_SDC_E0156186 #if H_3D_INTER_SDC 193 187 m_cInterSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG ); 194 188 m_cInterSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL ); … … 232 226 curCost += m_cCUICFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_IC_FLAG ); 233 227 #endif 234 #if LGE_INTER_SDC_E0156228 #if H_3D_INTER_SDC 235 229 curCost += m_cInterSDCFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_INTER_SDC_FLAG ); 236 230 curCost += m_cInterSDCResidualSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL ); … … 268 262 #if H_3D_DIM_DMM 269 263 curCost += m_cDmm1DataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DMM1_DATA ); 270 #if !SEC_DMM2_E0146_HHIFIX271 curCost += m_cDmm2DataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DMM2_DATA );272 #endif273 264 curCost += m_cDmm3DataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DMM3_DATA ); 274 265 #endif … … 340 331 #if H_3D_DIM_DMM 341 332 m_cDmm1DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA ); 342 #if !SEC_DMM2_E0146_HHIFIX343 m_cDmm2DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM2_DATA );344 #endif345 333 m_cDmm3DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM3_DATA ); 346 334 #endif … … 353 341 #endif 354 342 #endif 355 #if LGE_INTER_SDC_E0156343 #if H_3D_INTER_SDC 356 344 m_cInterSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG ); 357 345 m_cInterSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL ); … … 548 536 } 549 537 } 550 551 #if !SEC_DMM2_E0146_HHIFIX552 Void TEncSbac::xCodeDmm2Offset( Int iOffset )553 {554 if( DMM2_DELTAEND_MAX > 0 )555 {556 m_pcBinIf->encodeBin( (iOffset != 0) , m_cDmm2DataSCModel.get(0, 0, 0) );557 if( iOffset != 0 )558 {559 UInt uiAbsValMinus1 = abs(iOffset)-1;560 m_pcBinIf->encodeBin( (uiAbsValMinus1 & 0x01), m_cDmm2DataSCModel.get(0, 0, 0) );561 m_pcBinIf->encodeBin( (uiAbsValMinus1 & 0x02) >> 1, m_cDmm2DataSCModel.get(0, 0, 0) );562 563 UInt uiSign = (iOffset > 0) ? 0 : 1;564 m_pcBinIf->encodeBinEP( uiSign );565 }566 }567 }568 #endif569 538 570 539 Void TEncSbac::xCodeDmm3WedgeIdx( UInt uiIntraIdx, Int iNumBit ) … … 1240 1209 xCodeDmm1WedgeIdx( pcCU->getDmmWedgeTabIdx( dimType, absPartIdx ), g_dmm1TabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] ); 1241 1210 } break; 1242 #if !SEC_DMM2_E0146_HHIFIX1243 case( DMM2_IDX ):1244 {1245 xCodeDmm2Offset( pcCU->getDmm2DeltaEnd( absPartIdx ) );1246 } break;1247 #endif1248 1211 case( DMM3_IDX ): 1249 1212 { … … 1294 1257 Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx ) 1295 1258 { 1296 #if ZJU_DEPTH_INTRA_MODE_E02041297 1259 UInt codeWordTable[3][7] = {{0, 0, 0, 2, 0,6, 7},{0, 0, 2, 7, 3, 6, 2},{0, 1, 0, 0, 0, 0, 0}}; 1298 1260 UInt codeWordLenTable[3][7] = {{0, 1, 0, 2, 0,3, 3},{1, 1, 2, 3, 2, 3, 2},{1, 1, 0, 0, 0, 0, 0}}; 1299 #else1300 #if LGE_SDC_REMOVE_DC_E01581301 #if SEC_DMM2_E0146_HHIFIX1302 UInt codeWordTable[3][7] = {{0, 0, 0, 2, 0,6, 7},{0, 2, 3, 4, 5, 6, 7},{0, 1, 0, 0, 0, 0, 0}};1303 UInt codeWordLenTable[3][7] = {{0, 1, 0, 2, 0,3, 3},{2, 3, 3, 3, 3, 3, 3},{1, 1, 0, 0, 0, 0, 0}};1304 #else1305 UInt codeWordTable[3][8] = { { 0, 0, 0, 2, 0, 6, 0, 7 }, { 0, 2, 3, 4, 5, 6, 15, 14 }, { 0, 1, 0, 0, 0, 0, 0, 0 } };1306 UInt codeWordLenTable[3][8] = { { 0, 1, 0, 2, 0, 3, 0, 3 }, { 2, 3, 3, 3, 3, 3, 4, 4 }, { 1, 1, 0, 0, 0, 0, 0, 0 } };1307 #endif1308 #else1309 #if SEC_DMM2_E0146_HHIFIX1310 UInt codeWordTable[3][8] = {{0, 0, 0, 2, 0,6, 0, 7},{0, 2, 3, 4, 5, 6, 14, 15},{0, 2, 0, 0, 0, 0, 3, 0}};1311 UInt codeWordLenTable[3][8] = {{0, 1, 0, 2, 0,3, 0, 3},{2, 3, 3, 3, 3, 3, 4, 4},{1, 2, 0, 0, 0, 0, 2, 0}};1312 #else1313 UInt codeWordTable[3][9] = {{0, 0, 0, 2, 0,6, 0, 0, 7},{0, 2, 3, 4, 5, 6, 14, 31, 30},{0, 2, 0, 0, 0, 0, 3, 0, 0}};1314 UInt codeWordLenTable[3][9] = {{0, 1, 0, 2, 0,3, 0, 0, 3},{2, 3, 3, 3, 3, 3, 4, 5, 5},{1, 2, 0, 0, 0, 0, 2, 0, 0}};1315 #endif1316 #endif1317 #endif1318 1261 UInt dir = pcCU->getLumaIntraDir( absPartIdx ); 1319 1262 UInt puIdx = (pcCU->getWidth(absPartIdx) == 64) ? 2 : ( (pcCU->getPartitionSize(absPartIdx) == SIZE_NxN && pcCU->getWidth(absPartIdx) == 8) ? 0 : 1 ); … … 1331 1274 case DMM4_IDX: codeIdx = 4; break; 1332 1275 case DMM3_IDX: codeIdx = 5; break; 1333 #if LGE_SDC_REMOVE_DC_E01581334 #if SEC_DMM2_E0146_HHIFIX1335 1276 case RBC_IDX: codeIdx = 6; break; 1336 #else1337 case DMM2_IDX: codeIdx = 6; break;1338 case RBC_IDX: codeIdx = 7; break;1339 #endif1340 #else1341 #if SEC_DMM2_E0146_HHIFIX1342 case RBC_IDX: codeIdx = 7; break;1343 #else1344 case DMM2_IDX: codeIdx = 7; break;1345 case RBC_IDX: codeIdx = 8; break;1346 #endif1347 #endif1348 1277 default: break; 1349 1278 } … … 1356 1285 { 1357 1286 case PLANAR_IDX: codeIdx = 0; break; 1358 #if !LGE_SDC_REMOVE_DC_E01581359 case DC_IDX: codeIdx = 6; break;1360 #endif1361 1287 default: codeIdx = 2; break; 1362 1288 } 1363 1289 } 1364 1290 #endif 1365 #if ZJU_DEPTH_INTRA_MODE_E02041366 1291 if( puIdx==1 ) 1367 1292 { … … 1375 1300 } 1376 1301 } 1377 #endif1378 1302 //mode coding 1379 1303 for( UInt i = 0; i < codeWordLenTable[puIdx][codeIdx]; i++ ) … … 2304 2228 } 2305 2229 2306 #if LGE_INTER_SDC_E01562230 #if H_3D_INTER_SDC 2307 2231 Void TEncSbac::codeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2308 2232 { -
TabularUnified trunk/source/Lib/TLibEncoder/TEncSbac.h ¶
r622 r655 121 121 #if H_3D_DIM_DMM 122 122 Void xCodeDmm1WedgeIdx ( UInt uiTabIdx, Int iNumBit ); 123 #if !SEC_DMM2_E0146_HHIFIX124 Void xCodeDmm2Offset ( Int iOffset );125 #endif126 123 Void xCodeDmm3WedgeIdx ( UInt uiIntraIdx, Int iNumBit ); 127 124 #endif … … 160 157 Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 161 158 #endif 162 #if LGE_INTER_SDC_E0156159 #if H_3D_INTER_SDC 163 160 Void codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 164 161 Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ); … … 256 253 #if H_3D_DIM_DMM 257 254 ContextModel3DBuffer m_cDmm1DataSCModel; 258 #if !SEC_DMM2_E0146_HHIFIX259 ContextModel3DBuffer m_cDmm2DataSCModel;260 #endif261 255 ContextModel3DBuffer m_cDmm3DataSCModel; 262 256 #endif … … 269 263 #endif 270 264 #endif 271 #if LGE_INTER_SDC_E0156265 #if H_3D_INTER_SDC 272 266 ContextModel3DBuffer m_cInterSDCFlagSCModel; 273 267 ContextModel3DBuffer m_cInterSDCResidualSCModel; -
TabularUnified trunk/source/Lib/TLibEncoder/TEncSearch.cpp ¶
r622 r655 41 41 #include "TEncSearch.h" 42 42 #include <math.h> 43 #if LGE_INTER_SDC_E015643 #if H_3D_INTER_SDC 44 44 #include <memory.h> 45 45 #endif … … 323 323 m_cDistParam.bUseIC = pcPatternKey->getICFlag(); 324 324 #endif 325 #if LGE_INTER_SDC_E0156325 #if H_3D_INTER_SDC 326 326 m_cDistParam.bUseSDCMRSAD = pcPatternKey->getSDCMRSADFlag(); 327 327 #endif … … 755 755 m_cDistParam.bUseIC = pcPatternKey->getICFlag(); 756 756 #endif 757 #if LGE_INTER_SDC_E0156757 #if H_3D_INTER_SDC 758 758 m_cDistParam.bUseSDCMRSAD = pcPatternKey->getSDCMRSADFlag(); 759 759 #endif … … 1900 1900 // get DC prediction for each segment 1901 1901 Pel apDCPredValues[2]; 1902 #if KWU_SDC_SIMPLE_DC_E01171903 1902 analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode ); 1904 #else1905 analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride );1906 #endif1907 1903 1908 1904 // get original DC for each segment 1909 1905 Pel apDCOrigValues[2]; 1910 #if KWU_SDC_SIMPLE_DC_E01171911 1906 analyzeSegmentsSDC(piOrg, uiStride, uiWidth, apDCOrigValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode, true ); 1912 #else1913 analyzeSegmentsSDC(piOrg, uiStride, uiWidth, apDCOrigValues, uiNumSegments, pbMask, uiMaskStride );1914 #endif1915 1907 1916 1908 for( UInt uiSegment = 0; uiSegment < uiNumSegments; uiSegment++ ) … … 2851 2843 { 2852 2844 2853 #if SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX2845 #if H_3D_FAST_DEPTH_INTRA 2854 2846 Int threshold = max(((pcCU->getQP(0))>>3)-1,3); 2855 2847 Int varThreshold = (Int)( threshold * threshold - 8 ); … … 2859 2851 #if H_3D_DIM_DMM 2860 2852 if( m_pcEncCfg->getUseDMM() 2861 #if SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX2853 #if H_3D_FAST_DEPTH_INTRA 2862 2854 && (uiRdModeList[0] != PLANAR_IDX || varCU >= varThreshold) 2863 2855 #endif … … 2866 2858 for( UInt dmmType = 0; dmmType < DMM_NUM_TYPE; dmmType++ ) 2867 2859 { 2860 #if H_3D_FCO 2861 TComPic* picTexture = pcCU->getSlice()->getIvPic(false, pcCU->getSlice()->getViewIndex() ); 2862 if ( !picTexture->getReconMark() && (DMM3_IDX == dmmType || DMM4_IDX == dmmType ) ) 2863 { 2864 continue; 2865 } 2866 #endif 2868 2867 UInt uiTabIdx = 0; 2869 2868 TComWedgelet* biSegmentation = NULL; … … 2877 2876 biSegmentation = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]); 2878 2877 } break; 2879 #if !SEC_DMM2_E0146_HHIFIX2880 case( DMM2_IDX ):2881 {2882 if( uiWidth > 4 )2883 {2884 Int dmm2DeltaEnd = 0;2885 xSearchDmm2Wedge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight, uiTabIdx, dmm2DeltaEnd );2886 pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dmmType, uiPartOffset, uiDepth + uiInitTrDepth );2887 pcCU->setDmm2DeltaEndSubParts( dmm2DeltaEnd, uiPartOffset, uiDepth + uiInitTrDepth );2888 biSegmentation = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]);2889 }2890 } break;2891 #endif2892 2878 case( DMM3_IDX ): 2893 2879 { 2894 #if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 2880 2895 2881 TComPic* pcPicTex = pcCU->getSlice()->getTexturePic(); 2896 2882 TComDataCU* pcColTexCU = pcPicTex->getCU( pcCU->getAddr() ); … … 2900 2886 if( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 ) 2901 2887 { 2902 #endif 2903 UInt uiIntraTabIdx = 0; 2904 #if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 2888 UInt uiIntraTabIdx = 0; 2905 2889 xSearchDmm3Wedge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight, uiTabIdx, uiIntraTabIdx, uiColTexIntraDir ); 2906 #else2907 xSearchDmm3Wedge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight, uiTabIdx, uiIntraTabIdx );2908 #endif2909 2890 pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dmmType, uiPartOffset, uiDepth + uiInitTrDepth ); 2910 2891 pcCU->setDmm3IntraTabIdxSubParts( uiIntraTabIdx, uiPartOffset, uiDepth + uiInitTrDepth ); 2911 2892 biSegmentation = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]); 2912 #if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX2913 2893 } 2914 #endif2915 2894 } break; 2916 2895 case( DMM4_IDX ): … … 2941 2920 #if H_3D_DIM_RBC 2942 2921 if( m_pcEncCfg->getUseRBC() 2943 #if SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX2922 #if H_3D_FAST_DEPTH_INTRA 2944 2923 && (uiRdModeList[0] != PLANAR_IDX || varCU >= varThreshold) 2945 2924 #endif … … 3581 3560 cDistParam.bUseIC = false; 3582 3561 #endif 3583 #if LGE_INTER_SDC_E01563562 #if H_3D_INTER_SDC 3584 3563 cDistParam.bUseSDCMRSAD = false; 3585 3564 #endif … … 3724 3703 */ 3725 3704 #if AMP_MRG 3726 #if MTK_FAST_TEXTURE_ENCODING_E01733705 #if H_3D_FAST_TEXTURE_ENCODING 3727 3706 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bFMD, Bool bUseRes, Bool bUseMRG ) 3728 3707 #else … … 3836 3815 #if AMP_MRG 3837 3816 Bool bTestNormalMC = true; 3838 #if MTK_FAST_TEXTURE_ENCODING_E01733817 #if H_3D_FAST_TEXTURE_ENCODING 3839 3818 if (bFMD||( bUseMRG && pcCU->getWidth( 0 ) > 8 && iNumPart == 2 )) 3840 3819 #else … … 4706 4685 pcPatternKey->setICFlag( bICFlag ); 4707 4686 #endif 4708 #if LGE_INTER_SDC_E01564687 #if H_3D_INTER_SDC 4709 4688 if ( pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) ) 4710 4689 { … … 4862 4841 m_cDistParam.bUseIC = pcPatternKey->getICFlag(); 4863 4842 #endif 4864 #if LGE_INTER_SDC_E01564843 #if H_3D_INTER_SDC 4865 4844 m_cDistParam.bUseSDCMRSAD = pcPatternKey->getSDCMRSADFlag(); 4866 4845 #endif … … 5471 5450 } 5472 5451 5473 #if LGE_INTER_SDC_E01565452 #if H_3D_INTER_SDC 5474 5453 Void TEncSearch::encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, TComYuv* pcOrg, TComYuv* pcPred, TComYuv* pcResi, TComYuv* pcRec, const UInt uiDepth ) 5475 5454 { … … 6794 6773 m_pcEntropyCoder->encodeARPW( pcCU , 0 ); 6795 6774 #endif 6796 #if LGE_INTER_SDC_E01566775 #if H_3D_INTER_SDC 6797 6776 m_pcEntropyCoder->encodeInterSDCFlag( pcCU, 0, true ); 6798 6777 #endif … … 7045 7024 } 7046 7025 7026 #if H_3D_DIM 7047 7027 // ------------------------------------------------------------------------------------------------------------------- 7048 7028 // Depth intra search 7049 7029 // ------------------------------------------------------------------------------------------------------------------- 7050 #if H_3D_DIM7051 7030 Void TEncSearch::xCalcBiSegDCs( Pel* ptrSrc, UInt srcStride, Bool* biSegPattern, Int patternStride, Pel& valDC1, Pel& valDC2 ) 7052 7031 { … … 7321 7300 } 7322 7301 7323 #if !SEC_DMM2_E0146_HHIFIX7324 Void TEncSearch::xSearchDmm2Wedge( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, Int& riWedgeDeltaEnd )7325 {7326 ruiTabIdx = 0;7327 riWedgeDeltaEnd = 0;7328 7329 // local pred buffer7330 TComYuv cPredYuv;7331 cPredYuv.create( uiWidth, uiHeight );7332 cPredYuv.clear();7333 7334 UInt uiPredStride = cPredYuv.getStride();7335 Pel* piPred = cPredYuv.getLumaAddr();7336 7337 7338 // regular wedge search7339 Dist uiBestDist = RDO_DIST_MAX;7340 UInt uiBestTabIdx = 0;7341 Int iBestDeltaEnd = 0;7342 7343 UInt uiIdx = 0;7344 Pel refDC1 = 0; Pel refDC2 = 0;7345 for( Int iTestDeltaEnd = -DMM2_DELTAEND_MAX; iTestDeltaEnd <= DMM2_DELTAEND_MAX; iTestDeltaEnd++ )7346 {7347 uiIdx = xPredWedgeFromIntra( pcCU, uiAbsPtIdx, uiWidth, uiHeight, iTestDeltaEnd );7348 TComWedgelet* pcWedgelet = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiIdx]);7349 xCalcBiSegDCs ( piRef, uiRefStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );7350 xAssignBiSegDCs( piPred, uiPredStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );7351 7352 Dist uiActDist = RDO_DIST_MAX;7353 #if H_3D_VSO7354 if( m_pcRdCost->getUseVSO() )7355 {7356 if( m_pcRdCost->getUseEstimatedVSD() )7357 {7358 uiActDist = m_pcRdCost->getDistPartVSD( pcCU, uiAbsPtIdx, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false );7359 }7360 else7361 {7362 uiActDist = m_pcRdCost->getDistPartVSO( pcCU, uiAbsPtIdx, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false );7363 }7364 }7365 else7366 #endif7367 {7368 uiActDist = m_pcRdCost->getDistPart( g_bitDepthY, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, TEXT_LUMA, DF_SAD );7369 }7370 7371 if( uiActDist < uiBestDist || uiBestDist == RDO_DIST_MAX )7372 {7373 uiBestDist = uiActDist;7374 uiBestTabIdx = uiIdx;7375 iBestDeltaEnd = iTestDeltaEnd;7376 }7377 else if( uiIdx == uiBestTabIdx && abs(iTestDeltaEnd) < abs(iBestDeltaEnd) )7378 {7379 iBestDeltaEnd = iTestDeltaEnd;7380 }7381 }7382 7383 ruiTabIdx = uiBestTabIdx;7384 riWedgeDeltaEnd = iBestDeltaEnd;7385 7386 cPredYuv.destroy();7387 return;7388 }7389 #endif7390 7391 #if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX7392 7302 Void TEncSearch::xSearchDmm3Wedge( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx, UInt colTexIntraDir ) 7393 7303 { … … 7426 7336 cPredYuv.destroy(); 7427 7337 } 7428 #else 7429 Void TEncSearch::xSearchDmm3Wedge( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx ) 7430 { 7431 ruiTabIdx = 0; 7432 ruiIntraTabIdx = 0; 7433 7434 // local pred buffer 7435 TComYuv cPredYuv; 7436 cPredYuv.create( uiWidth, uiHeight ); 7437 cPredYuv.clear(); 7438 Pel* piPred = cPredYuv.getLumaAddr(); 7439 UInt uiPredStride = cPredYuv.getStride(); 7440 7441 // wedge search 7442 UInt uiBestDist = MAX_UINT; 7443 WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])]; 7444 Pel refDC1 = 0; Pel refDC2 = 0; 7445 7446 TComPic* pcPicTex = pcCU->getSlice()->getTexturePic(); 7447 assert( pcPicTex != NULL ); 7448 TComDataCU* pcColTexCU = pcPicTex->getCU(pcCU->getAddr()); 7449 UInt uiTexPartIdx = pcCU->getZorderIdxInCU() + uiAbsPtIdx; 7450 Int uiColTexIntraDir = pcColTexCU->isIntra( uiTexPartIdx ) ? pcColTexCU->getLumaIntraDir( uiTexPartIdx ) : 255; 7451 7452 std::vector< std::vector<UInt> > pauiWdgLstSz = g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]]; 7453 if( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 ) 7454 { 7455 std::vector<UInt>* pauiWdgLst = &pauiWdgLstSz[uiColTexIntraDir-2]; 7456 for( UInt uiIdxW = 0; uiIdxW < pauiWdgLst->size(); uiIdxW++ ) 7457 { 7458 UInt uiIdx = pauiWdgLst->at(uiIdxW); 7459 TComWedgelet* pcWedgelet = &(pacWedgeList->at(uiIdx)); 7460 xCalcBiSegDCs ( piRef, uiRefStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 ); 7461 xAssignBiSegDCs( piPred, uiPredStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 ); 7462 7463 UInt uiActDist = m_pcRdCost->getDistPart( g_bitDepthY, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, TEXT_LUMA, DF_SAD ); 7464 if( uiActDist < uiBestDist || uiBestDist == MAX_UINT ) 7465 { 7466 uiBestDist = uiActDist; 7467 ruiTabIdx = uiIdx; 7468 ruiIntraTabIdx = uiIdxW; 7469 } 7470 } 7471 } 7472 else 7473 { 7474 WedgeNodeList* pacWedgeNodeList = &g_dmmWedgeNodeLists[(g_aucConvertToBit[uiWidth])]; 7475 UInt uiBestNodeDist = MAX_UINT; 7476 UInt uiBestNodeId = 0; 7477 for( UInt uiNodeId = 0; uiNodeId < pacWedgeNodeList->size(); uiNodeId++ ) 7478 { 7479 TComWedgelet* pcWedgelet = &(pacWedgeList->at(pacWedgeNodeList->at(uiNodeId).getPatternIdx())); 7480 xCalcBiSegDCs ( piRef, uiRefStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 ); 7481 xAssignBiSegDCs( piPred, uiPredStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 ); 7482 7483 UInt uiActDist = m_pcRdCost->getDistPart( g_bitDepthY, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, TEXT_LUMA, DF_SAD ); 7484 if( uiActDist < uiBestNodeDist || uiBestNodeDist == MAX_UINT ) 7485 { 7486 uiBestNodeDist = uiActDist; 7487 uiBestNodeId = uiNodeId; 7488 ruiIntraTabIdx = uiNodeId; 7489 } 7490 } 7491 ruiTabIdx = pacWedgeNodeList->at(uiBestNodeId).getPatternIdx(); 7492 } 7493 7494 cPredYuv.destroy(); 7495 } 7496 #endif 7338 7497 7339 #endif 7498 7340 #if H_3D_DIM_RBC -
TabularUnified trunk/source/Lib/TLibEncoder/TEncSearch.h ¶
r622 r655 196 196 TComYuv*& rpcResiYuv, 197 197 TComYuv*& rpcRecoYuv, 198 #if MTK_FAST_TEXTURE_ENCODING_E0173198 #if H_3D_FAST_TEXTURE_ENCODING 199 199 Bool bFMD, 200 200 #endif … … 213 213 TComYuv*& rpcYuvRec, 214 214 Bool bSkipRes ); 215 #if LGE_INTER_SDC_E0156215 #if H_3D_INTER_SDC 216 216 Void encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, 217 217 TComYuv* pcOrg, … … 343 343 UInt stateU0V1Both2 ); 344 344 345 345 #if H_3D_DIM 346 346 // ------------------------------------------------------------------------------------------------------------------- 347 347 // Depth intra search 348 348 // ------------------------------------------------------------------------------------------------------------------- 349 #if H_3D_DIM350 349 Void xCalcBiSegDCs ( Pel* ptrSrc, UInt srcStride, Bool* biSegPattern, Int patternStride, Pel& valDC1, Pel& valDC2 ); 351 350 #if H_3D_DIM_DMM 352 351 Void xSearchDmmDeltaDCs ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piOrig, Pel* piPredic, UInt uiStride, Bool* biSegPattern, Int patternStride, UInt uiWidth, UInt uiHeight, Pel& rDeltaDC1, Pel& rDeltaDC2 ); 353 352 Void xSearchDmm1Wedge ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx ); 354 #if !SEC_DMM2_E0146_HHIFIX355 Void xSearchDmm2Wedge ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, Int& riWedgeDeltaEnd );356 #endif357 #if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX358 353 Void xSearchDmm3Wedge ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx, UInt colTexIntraDir ); 359 #else360 Void xSearchDmm3Wedge ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx );361 #endif362 354 #endif 363 355 #if H_3D_DIM_RBC -
TabularUnified trunk/source/Lib/TLibEncoder/TEncSlice.cpp ¶
r622 r655 157 157 m_pdRdPicQp = (Double*)xMalloc( Double, m_pcCfg->getDeltaQpRD() * 2 + 1 ); 158 158 m_piRdPicQp = (Int* )xMalloc( Int, m_pcCfg->getDeltaQpRD() * 2 + 1 ); 159 #if KWU_RC_MADPRED_E0227 160 if(m_pcCfg->getUseRateCtrl()) 161 { 162 m_pcRateCtrl = pcEncTop->getRateCtrl(); 163 } 164 else 165 { 166 m_pcRateCtrl = NULL; 167 } 168 #else 159 169 m_pcRateCtrl = pcEncTop->getRateCtrl(); 170 #endif 160 171 } 161 172 … … 176 187 \param pPPS PPS associated with the slice 177 188 */ 178 #if H_MV5179 189 #if H_MV 180 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS, Int layerId ) 181 #else 182 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS ) 183 #endif 184 #else 185 #if H_3D 186 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS, Int layerId ) 187 #else 188 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS ) 189 #endif 190 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS, Int layerId, bool isField ) 191 #else 192 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS, bool isField ) 190 193 #endif 191 194 { … … 195 198 rpcSlice = pcPic->getSlice(0); 196 199 197 #if H_MV 5200 #if H_MV 198 201 rpcSlice->setVPS( pVPS ); 199 202 … … 203 206 #if H_3D 204 207 rpcSlice->setIsDepth ( pVPS->getDepthId ( layerId ) != 0 ); 205 #endif206 #else207 #if H_3D208 // GT: Should also be activated for MV-HEVC at some stage209 rpcSlice->setVPS( pVPS );210 Int vpsLayerId = pVPS->getLayerIdInNuh( layerId );211 212 rpcSlice->setLayerId ( layerId );213 rpcSlice->setViewId ( pVPS->getViewId ( vpsLayerId ) );214 rpcSlice->setViewIndex ( pVPS->getViewIndex ( vpsLayerId ) );215 rpcSlice->setIsDepth ( pVPS->getDepthId ( vpsLayerId ) != 0 );216 208 #endif 217 209 #endif … … 342 334 Int NumberBFrames = ( m_pcCfg->getGOPSize() - 1 ); 343 335 Int SHIFT_QP = 12; 344 Double dLambda_scale = 1.0 - Clip3( 0.0, 0.5, 0.05*(Double) NumberBFrames);336 Double dLambda_scale = 1.0 - Clip3( 0.0, 0.5, 0.05*(Double)(isField ? NumberBFrames/2 : NumberBFrames) ); 345 337 #if FULL_NBIT 346 338 Int bitdepth_luma_qp_scale = 6 * (g_bitDepth - 8); … … 1125 1117 if(m_pcCfg->getUseRateCtrl()) 1126 1118 { 1119 #if KWU_RC_MADPRED_E0227 1120 if(pcSlice->getLayerId() != 0 && m_pcCfg->getUseDepthMADPred() && !pcSlice->getIsDepth()) 1121 { 1122 Double zn, zf, focallength, position, camshift; 1123 Double basepos; 1124 Bool bInterpolated; 1125 Int direction = pcSlice->getViewId() - pcCU->getSlice()->getIvPic(false, 0)->getViewId(); 1126 1127 pcEncTop->getCamParam()->xGetZNearZFar(pcEncTop->getCamParam()->getBaseViewNumbers()[pcSlice->getViewIndex()], pcSlice->getPOC(), zn, zf); 1128 pcEncTop->getCamParam()->xGetGeometryData(pcEncTop->getCamParam()->getBaseViewNumbers()[0], pcSlice->getPOC(), focallength, basepos, camshift, bInterpolated); 1129 pcEncTop->getCamParam()->xGetGeometryData(pcEncTop->getCamParam()->getBaseViewNumbers()[pcSlice->getViewIndex()], pcSlice->getPOC(), focallength, position, camshift, bInterpolated); 1130 1131 m_pcRateCtrl->updateLCUDataEnhancedView(pcCU, pcCU->getTotalBits(), pcCU->getQP(0), basepos, position, focallength, zn, zf, (direction > 0 ? 1 : -1)); 1132 } 1133 #endif 1127 1134 if(m_pcRateCtrl->calculateUnitQP()) 1128 1135 { … … 1223 1230 else 1224 1231 { 1232 #if KWU_RC_MADPRED_E0227 1233 if(pcSlice->getLayerId() != 0 && m_pcCfg->getUseDepthMADPred() && !pcSlice->getIsDepth()) 1234 { 1235 Double zn, zf, focallength, position, camShift; 1236 Double basePos; 1237 Bool bInterpolated; 1238 Int direction = pcSlice->getViewId() - pcCU->getSlice()->getIvPic(false, 0)->getViewId(); 1239 Int disparity; 1240 1241 pcEncTop->getCamParam()->xGetZNearZFar(pcEncTop->getCamParam()->getBaseViewNumbers()[pcSlice->getViewIndex()], pcSlice->getPOC(), zn, zf); 1242 pcEncTop->getCamParam()->xGetGeometryData(pcEncTop->getCamParam()->getBaseViewNumbers()[0], pcSlice->getPOC(), focallength, basePos, camShift, bInterpolated); 1243 pcEncTop->getCamParam()->xGetGeometryData(pcEncTop->getCamParam()->getBaseViewNumbers()[pcSlice->getViewIndex()], pcSlice->getPOC(), focallength, position, camShift, bInterpolated); 1244 bpp = m_pcRateCtrl->getRCPic()->getLCUTargetBppforInterView( m_pcRateCtrl->getPicList(), pcCU, 1245 basePos, position, focallength, zn, zf, (direction > 0 ? 1 : -1), &disparity ); 1246 } 1247 else 1248 { 1249 #endif 1225 1250 #if RATE_CONTROL_INTRA 1226 1251 bpp = m_pcRateCtrl->getRCPic()->getLCUTargetBpp(pcSlice->getSliceType()); … … 1239 1264 estQP = m_pcRateCtrl->getRCPic()->getLCUEstQP ( estLambda, pcSlice->getSliceQp() ); 1240 1265 #endif 1241 1266 #if KWU_RC_MADPRED_E0227 1267 } 1268 #endif 1269 #if KWU_RC_MADPRED_E0227 1270 estLambda = m_pcRateCtrl->getRCPic()->getLCUEstLambda( bpp ); 1271 estQP = m_pcRateCtrl->getRCPic()->getLCUEstQP ( estLambda, pcSlice->getSliceQp() ); 1272 #endif 1242 1273 estQP = Clip3( -pcSlice->getSPS()->getQpBDOffsetY(), MAX_QP, estQP ); 1243 1274 … … 1343 1374 if ( m_pcCfg->getUseRateCtrl() ) 1344 1375 { 1345 #if !M0036_RC_IMPROVEMENT 1376 #if !M0036_RC_IMPROVEMENT || KWU_RC_MADPRED_E0227 1346 1377 UInt SAD = m_pcCuEncoder->getLCUPredictionSAD(); 1347 1378 Int height = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getSPS()->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() ); -
TabularUnified trunk/source/Lib/TLibEncoder/TEncSlice.h ¶
r622 r655 116 116 117 117 /// preparation of slice encoding (reference marking, QP and lambda) 118 #if H_MV5119 118 #if H_MV 120 119 Void initEncSlice ( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, 121 Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS, Int layerId );120 Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS, Int layerId, bool isField ); 122 121 #else 123 122 Void initEncSlice ( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, 124 Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS ); 125 #endif 126 #else 127 #if H_3D 128 Void initEncSlice ( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, 129 Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS, Int layerId ); 130 #else 131 Void initEncSlice ( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, 132 Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS ); 133 #endif 123 Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS, bool isField ); 134 124 #endif 135 125 #if RATE_CONTROL_LAMBDA_DOMAIN -
TabularUnified trunk/source/Lib/TLibEncoder/TEncTop.cpp ¶
r622 r655 123 123 if ( m_RCEnableRateControl ) 124 124 { 125 #if KWU_RC_MADPRED_E0227 126 m_cRateCtrl.init( m_framesToBeEncoded, m_RCTargetBitrate, m_iFrameRate, m_iGOPSize, m_iSourceWidth, m_iSourceHeight, 127 g_uiMaxCUWidth, g_uiMaxCUHeight, m_RCKeepHierarchicalBit, m_RCUseLCUSeparateModel, m_GOPList, getLayerId() ); 128 #else 125 129 m_cRateCtrl.init( m_framesToBeEncoded, m_RCTargetBitrate, m_iFrameRate, m_iGOPSize, m_iSourceWidth, m_iSourceHeight, 126 130 g_uiMaxCUWidth, g_uiMaxCUHeight, m_RCKeepHierarchicalBit, m_RCUseLCUSeparateModel, m_GOPList ); 131 #endif 127 132 } 128 133 #else 129 m_cRateCtrl.create(getIntraPeriod(), getGOPSize(), getFrameRate(), getTargetBitrate(), getQP(), getNumLCUInUnit(), getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight); 134 #if KWU_FIX_URQ 135 if(m_enableRateCtrl) 136 #endif 137 m_cRateCtrl.create(getIntraPeriod(), getGOPSize(), getFrameRate(), getTargetBitrate(), getQP(), getNumLCUInUnit(), getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight); 130 138 #endif 131 139 // if SBAC-based RD optimization is used … … 284 292 } 285 293 286 Void TEncTop::init() 294 #if KWU_RC_MADPRED_E0227 295 Void TEncTop::init(TAppEncTop* pcTAppEncTop, Bool isFieldCoding) 296 #else 297 Void TEncTop::init(Bool isFieldCoding) 298 #endif 287 299 { 288 300 // initialize SPS … … 301 313 m_cPPS.setSPS(&m_cSPS); 302 314 xInitPPS(); 303 xInitRPS( );315 xInitRPS(isFieldCoding); 304 316 305 317 xInitPPSforTiles(); … … 310 322 m_cCuEncoder. init( this ); 311 323 324 #if KWU_RC_MADPRED_E0227 325 m_pcTAppEncTop = pcTAppEncTop; 326 #endif 312 327 // initialize transform & quantization class 313 328 m_pcCavlcCoder = getCavlcCoder(); … … 392 407 if( picLastCoded ) 393 408 { 394 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170395 409 picLastCoded->compressMotion(1); 396 #else397 picLastCoded->compressMotion();398 #endif399 410 } 400 411 #endif … … 433 444 #if H_MV 434 445 } 435 m_cGOPEncoder.compressPicInGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut, gopId );446 m_cGOPEncoder.compressPicInGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut, gopId, false, false ); 436 447 437 448 if( gopId + 1 == m_cGOPEncoder.getGOPSize() ) … … 439 450 #else 440 451 // compress GOP 441 m_cGOPEncoder.compressGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut );452 m_cGOPEncoder.compressGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut, false, false); 442 453 #endif 443 454 … … 456 467 #endif 457 468 } 469 /**------------------------------------------------ 470 Separate interlaced frame into two fields 471 -------------------------------------------------**/ 472 void separateFields(Pel* org, Pel* dstField, UInt stride, UInt width, UInt height, bool isTop) 473 { 474 if (!isTop) 475 { 476 org += stride; 477 } 478 for (Int y = 0; y < height>>1; y++) 479 { 480 for (Int x = 0; x < width; x++) 481 { 482 dstField[x] = org[x]; 483 } 484 485 dstField += stride; 486 org += stride*2; 487 } 488 489 } 490 491 #if H_MV 492 Void TEncTop::encode(Bool flush, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded, bool isTff, Int gopId ) 493 { 494 assert( 0 ); // Field coding and multiview need to be furhter harmonized. 495 } 496 #else 497 Void TEncTop::encode(Bool flush, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded, bool isTff) 498 { 499 /* -- TOP FIELD -- */ 500 501 if (pcPicYuvOrg) 502 { 503 504 /* -- Top field initialization -- */ 505 506 TComPic *pcTopField; 507 xGetNewPicBuffer( pcTopField ); 508 pcTopField->getPicSym()->allocSaoParam(&m_cEncSAO); 509 pcTopField->setReconMark (false); 510 511 pcTopField->getSlice(0)->setPOC( m_iPOCLast ); 512 pcTopField->getPicYuvRec()->setBorderExtension(false); 513 pcTopField->setTopField(isTff); 514 515 int nHeight = pcPicYuvOrg->getHeight(); 516 int nWidth = pcPicYuvOrg->getWidth(); 517 int nStride = pcPicYuvOrg->getStride(); 518 int nPadLuma = pcPicYuvOrg->getLumaMargin(); 519 int nPadChroma = pcPicYuvOrg->getChromaMargin(); 520 521 // Get pointers 522 Pel * PicBufY = pcPicYuvOrg->getBufY(); 523 Pel * PicBufU = pcPicYuvOrg->getBufU(); 524 Pel * PicBufV = pcPicYuvOrg->getBufV(); 525 526 Pel * pcTopFieldY = pcTopField->getPicYuvOrg()->getLumaAddr(); 527 Pel * pcTopFieldU = pcTopField->getPicYuvOrg()->getCbAddr(); 528 Pel * pcTopFieldV = pcTopField->getPicYuvOrg()->getCrAddr(); 529 530 // compute image characteristics 531 if ( getUseAdaptiveQP() ) 532 { 533 m_cPreanalyzer.xPreanalyze( dynamic_cast<TEncPic*>( pcTopField ) ); 534 } 535 536 /* -- Defield -- */ 537 538 bool isTop = isTff; 539 540 separateFields(PicBufY + nPadLuma + nStride*nPadLuma, pcTopFieldY, nStride, nWidth, nHeight, isTop); 541 separateFields(PicBufU + nPadChroma + (nStride >> 1)*nPadChroma, pcTopFieldU, nStride >> 1, nWidth >> 1, nHeight >> 1, isTop); 542 separateFields(PicBufV + nPadChroma + (nStride >> 1)*nPadChroma, pcTopFieldV, nStride >> 1, nWidth >> 1, nHeight >> 1, isTop); 543 544 } 545 546 if (m_iPOCLast == 0) // compress field 0 547 { 548 m_cGOPEncoder.compressGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut, true, isTff); 549 } 550 551 /* -- BOTTOM FIELD -- */ 552 553 if (pcPicYuvOrg) 554 { 555 556 /* -- Bottom field initialization -- */ 557 558 TComPic* pcBottomField; 559 xGetNewPicBuffer( pcBottomField ); 560 pcBottomField->getPicSym()->allocSaoParam(&m_cEncSAO); 561 pcBottomField->setReconMark (false); 562 563 TComPicYuv* rpcPicYuvRec = new TComPicYuv; 564 if ( rcListPicYuvRecOut.size() == (UInt)m_iGOPSize ) 565 { 566 rpcPicYuvRec = rcListPicYuvRecOut.popFront(); 567 } 568 else 569 { 570 rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 571 } 572 rcListPicYuvRecOut.pushBack( rpcPicYuvRec ); 573 574 pcBottomField->getSlice(0)->setPOC( m_iPOCLast); 575 pcBottomField->getPicYuvRec()->setBorderExtension(false); 576 pcBottomField->setTopField(!isTff); 577 578 int nHeight = pcPicYuvOrg->getHeight(); 579 int nWidth = pcPicYuvOrg->getWidth(); 580 int nStride = pcPicYuvOrg->getStride(); 581 int nPadLuma = pcPicYuvOrg->getLumaMargin(); 582 int nPadChroma = pcPicYuvOrg->getChromaMargin(); 583 584 // Get pointers 585 Pel * PicBufY = pcPicYuvOrg->getBufY(); 586 Pel * PicBufU = pcPicYuvOrg->getBufU(); 587 Pel * PicBufV = pcPicYuvOrg->getBufV(); 588 589 Pel * pcBottomFieldY = pcBottomField->getPicYuvOrg()->getLumaAddr(); 590 Pel * pcBottomFieldU = pcBottomField->getPicYuvOrg()->getCbAddr(); 591 Pel * pcBottomFieldV = pcBottomField->getPicYuvOrg()->getCrAddr(); 592 593 // Compute image characteristics 594 if ( getUseAdaptiveQP() ) 595 { 596 m_cPreanalyzer.xPreanalyze( dynamic_cast<TEncPic*>( pcBottomField ) ); 597 } 598 599 /* -- Defield -- */ 600 601 bool isTop = !isTff; 602 603 separateFields(PicBufY + nPadLuma + nStride*nPadLuma, pcBottomFieldY, nStride, nWidth, nHeight, isTop); 604 separateFields(PicBufU + nPadChroma + (nStride >> 1)*nPadChroma, pcBottomFieldU, nStride >> 1, nWidth >> 1, nHeight >> 1, isTop); 605 separateFields(PicBufV + nPadChroma + (nStride >> 1)*nPadChroma, pcBottomFieldV, nStride >> 1, nWidth >> 1, nHeight >> 1, isTop); 606 607 } 608 609 if ( ( !(m_iNumPicRcvd) || (!flush && m_iPOCLast != 1 && m_iNumPicRcvd != m_iGOPSize && m_iGOPSize)) ) 610 { 611 iNumEncoded = 0; 612 return; 613 } 614 615 // compress GOP 616 m_cGOPEncoder.compressGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut, true, isTff); 617 618 iNumEncoded = m_iNumPicRcvd; 619 m_iNumPicRcvd = 0; 620 m_uiNumAllPicCoded += iNumEncoded; 621 } 622 #endif 623 624 458 625 459 626 // ==================================================================================================================== … … 551 718 * that chooses the actual compatibility based upon options */ 552 719 553 #if H_MV5554 720 #if H_MV 555 721 m_cSPS.setUpdateRepFormatFlag ( m_layerId == 0 ); 556 722 m_cSPS.setSpsInferScalingListFlag ( m_layerId > 0 && m_cVPS->getInDirectDependencyFlag( getLayerIdInVps(), 0 ) ); 557 723 m_cSPS.setSpsScalingListRefLayerId ( 0 ); 558 #endif559 724 #endif 560 725 m_cSPS.setPicWidthInLumaSamples ( m_iSourceWidth ); … … 680 845 { 681 846 #if H_MV 682 #if H_MV5683 847 m_cPPS.setLayerId( getLayerId() ); 684 848 if( getVPS()->getNumDirectRefLayers( getLayerId() ) > 0 ) 685 #else686 if( getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) > 0 )687 #endif688 849 { 689 850 m_cPPS.setListsModificationPresentFlag( true ); … … 734 895 #if RATE_CONTROL_LAMBDA_DOMAIN 735 896 if ( m_RCEnableRateControl ) 897 { 898 m_cPPS.setUseDQP(true); 899 m_cPPS.setMaxCuDQPDepth( 0 ); 900 m_cPPS.setMinCuDQPSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuDQPDepth()) ); 901 } 902 #endif 903 #if !RATE_CONTROL_LAMBDA_DOMAIN && KWU_FIX_URQ 904 if ( m_enableRateCtrl ) 736 905 { 737 906 m_cPPS.setUseDQP(true); … … 751 920 m_cPPS.setOutputFlagPresentFlag( false ); 752 921 #if H_MV 753 #if H_MV5754 922 m_cPPS.setNumExtraSliceHeaderBits( 2 ); 755 #else756 m_cPPS.setNumExtraSliceHeaderBits( 1 );757 #endif758 923 #endif 759 924 m_cPPS.setSignHideFlag(getSignHideFlag()); 760 m_cPPS.setDeblockingFilterControlPresentFlag (m_DeblockingFilterControlPresent ); 925 if ( getDeblockingFilterMetric() ) 926 { 927 m_cPPS.setDeblockingFilterControlPresentFlag (true); 928 m_cPPS.setDeblockingFilterOverrideEnabledFlag(true); 929 m_cPPS.setPicDisableDeblockingFilterFlag(false); 930 m_cPPS.setDeblockingFilterBetaOffsetDiv2(0); 931 m_cPPS.setDeblockingFilterTcOffsetDiv2(0); 932 } 933 else 934 { 935 m_cPPS.setDeblockingFilterControlPresentFlag (m_DeblockingFilterControlPresent ); 936 } 761 937 m_cPPS.setLog2ParallelMergeLevelMinus2 (m_log2ParallelMergeLevelMinus2 ); 762 938 m_cPPS.setCabacInitPresentFlag(CABAC_INIT_PRESENT_FLAG); … … 812 988 813 989 //Function for initializing m_RPSList, a list of TComReferencePictureSet, based on the GOPEntry objects read from the config file. 814 Void TEncTop::xInitRPS( )990 Void TEncTop::xInitRPS(Bool isFieldCoding) 815 991 { 816 992 TComReferencePictureSet* rps; 817 993 818 m_cSPS.createRPSList(getGOPSize()+m_extraRPSs );994 m_cSPS.createRPSList(getGOPSize()+m_extraRPSs+1); 819 995 TComRPSList* rpsList = m_cSPS.getRPSList(); 820 996 … … 913 1089 printf("Warning: number of negative pictures in RPS is different between intra and inter RPS specified in the config file.\n"); 914 1090 rps->setNumberOfNegativePictures(numNeg); 915 rps->setNumberOfP ositivePictures(numNeg+numPos);1091 rps->setNumberOfPictures(numNeg+numPos); 916 1092 } 917 1093 if (numPos != rps->getNumberOfPositivePictures()) … … 919 1095 printf("Warning: number of positive pictures in RPS is different between intra and inter RPS specified in the config file.\n"); 920 1096 rps->setNumberOfPositivePictures(numPos); 921 rps->setNumberOfP ositivePictures(numNeg+numPos);1097 rps->setNumberOfPictures(numNeg+numPos); 922 1098 } 923 1099 RPSTemp.setNumberOfPictures(numNeg+numPos); … … 983 1159 #endif //INTER_RPS_AUTO 984 1160 } 985 1161 //In case of field coding, we need to set special parameters for the first bottom field of the sequence, since it is not specified in the cfg file. 1162 //The position = GOPSize + extraRPSs which is (a priori) unused is reserved for this field in the RPS. 1163 if (isFieldCoding) 1164 { 1165 rps = rpsList->getReferencePictureSet(getGOPSize()+m_extraRPSs); 1166 rps->setNumberOfPictures(1); 1167 rps->setNumberOfNegativePictures(1); 1168 rps->setNumberOfPositivePictures(0); 1169 rps->setNumberOfLongtermPictures(0); 1170 rps->setDeltaPOC(0,-1); 1171 rps->setPOC(0,0); 1172 rps->setUsed(0,true); 1173 rps->setInterRPSPrediction(false); 1174 rps->setDeltaRIdxMinus1(0); 1175 rps->setDeltaRPS(0); 1176 rps->setNumRefIdc(0); 1177 } 986 1178 } 987 1179 … … 1028 1220 } 1029 1221 } 1222 if(POCCurr == 1 && slice->getPic()->isField()) 1223 { 1224 slice->setRPSidx(m_iGOPSize+m_extraRPSs); 1225 } 1030 1226 1031 1227 slice->setRPS(getSPS()->getRPSList()->getReferencePictureSet(slice->getRPSidx())); … … 1147 1343 } 1148 1344 #if H_MV 1149 Void TEncTop::printSummary( Int numAllPicCoded ) 1150 { 1345 Void TEncTop::printSummary( Int numAllPicCoded, Bool isField ) 1346 { 1347 assert ( !isField ); // Multiview and field coding need to be further unified 1151 1348 assert (numAllPicCoded == m_cAnalyzeAll.getNumPic()); 1152 1349 -
TabularUnified trunk/source/Lib/TLibEncoder/TEncTop.h ¶
r608 r655 64 64 // ==================================================================================================================== 65 65 66 #if KWU_RC_MADPRED_E0227 67 class TAppEncTop; 68 #endif 66 69 /// encoder class 67 70 class TEncTop : public TEncCfg … … 124 127 TComScalingList m_scalingList; ///< quantization matrix information 125 128 TEncRateCtrl m_cRateCtrl; ///< Rate control class 129 130 #if KWU_RC_MADPRED_E0227 131 TAppEncTop* m_pcTAppEncTop; 132 TAppComCamPara* m_cCamParam; 133 #endif 126 134 127 135 #if H_MV … … 137 145 138 146 Void xInitPPSforTiles (); 139 Void xInitRPS ( );///< initialize PPS from encoder options147 Void xInitRPS (Bool isFieldCoding); ///< initialize PPS from encoder options 140 148 141 149 public: … … 145 153 Void create (); 146 154 Void destroy (); 147 Void init (); 155 #if KWU_RC_MADPRED_E0227 156 Void init ( TAppEncTop* pcTAppEncTop, Bool isFieldCoding ); 157 #else 158 Void init (Bool isFieldCoding); 159 #endif 160 148 161 #if H_MV 149 162 TComPicLists* getIvPicLists() { return m_ivPicLists; } … … 185 198 TEncSbac* getRDGoOnSbacCoders () { return m_pcRDGoOnSbacCoders; } 186 199 TEncRateCtrl* getRateCtrl () { return &m_cRateCtrl; } 200 #if KWU_RC_MADPRED_E0227 201 TAppEncTop* getEncTop () { return m_pcTAppEncTop; } 202 TAppComCamPara* getCamParam() { return m_cCamParam;} 203 Void setCamParam(TAppComCamPara * pCamparam) { m_cCamParam = pCamparam;} 204 #endif 187 205 TComSPS* getSPS () { return &m_cSPS; } 188 206 TComPPS* getPPS () { return &m_cPPS; } … … 210 228 #if H_MV 211 229 Void encode( Bool bEos, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded , Int gopId ); 230 231 /// encode several number of pictures until end-of-sequence 232 Void encode( bool bEos, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, 233 std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded, bool isTff , Int gopId ); 234 212 235 #else 213 236 Void encode( Bool bEos, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, 214 std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded ); 215 #endif 216 217 #if H_MV 218 Void printSummary ( Int numAllPicCoded ); 219 #else 220 void printSummary() { m_cGOPEncoder.printOutSummary (m_uiNumAllPicCoded); } 237 std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded ); 238 /// encode several number of pictures until end-of-sequence 239 Void encode( bool bEos, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, 240 std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded, bool isTff); 241 242 #endif 243 244 #if H_MV 245 Void printSummary ( Int numAllPicCoded, bool isField ); 246 #else 247 Void printSummary(bool isField) { m_cGOPEncoder.printOutSummary (m_uiNumAllPicCoded, isField); } 221 248 #endif 222 249 -
TabularUnified trunk/source/Lib/TLibExtractor/TExtrTop.cpp ¶
r622 r655 100 100 Void TExtrTop::dumpVpsInfo( std::ostream& rcVpsInfoHandle ) 101 101 { 102 #if H_MV5103 102 rcVpsInfoHandle << "MaxLayers = " << m_cVPS.getMaxLayersMinus1() + 1 << std::endl; 104 103 rcVpsInfoHandle << "MaxNuhLayerId = " << m_cVPS.getVpsMaxLayerId() << std::endl; … … 114 113 #endif 115 114 rcVpsInfoHandle << "ViewId = " << m_cVPS.getViewId ( layerId ) << std::endl; 116 #else117 rcVpsInfoHandle << "MaxLayers = " << m_cVPS.getMaxLayers() << std::endl;118 rcVpsInfoHandle << "MaxNuhLayerId = " << m_cVPS.getVpsMaxLayerId() << std::endl;119 120 for ( Int layerIdxInVps = 0; layerIdxInVps < m_cVPS.getMaxLayers(); layerIdxInVps++ )121 {122 rcVpsInfoHandle << "LayerIdxInVps = " << layerIdxInVps << std::endl;123 rcVpsInfoHandle << "LayerIdInNuh = " << m_cVPS.getLayerIdInNuh( layerIdxInVps ) << std::endl;124 rcVpsInfoHandle << "ViewId = " << m_cVPS.getViewId ( layerIdxInVps ) << std::endl;125 #if H_3D126 rcVpsInfoHandle << "DepthFlag = " << m_cVPS.getViewIndex ( layerIdxInVps ) << std::endl;127 rcVpsInfoHandle << "DepthFlag = " << m_cVPS.getDepthId ( layerIdxInVps ) << std::endl;128 #endif129 #endif130 115 } 131 116 } -
TabularUnified trunk/source/Lib/TLibRenderer/TRenTop.cpp ¶
r608 r655 1033 1033 for ( ; iInterPolPos <= xCeil (iShiftedPos ) -1 ; iInterPolPos++) 1034 1034 { 1035 #if H_3D_FIX_REN1036 1035 if ( ( iInterPolPos >= 0 ) && ( iInterPolPos < iOutputWidth ) ) 1037 1036 { … … 1050 1049 } 1051 1050 } 1052 #else1053 for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)1054 {1055 if ( ( iInterPolPos >= 0 ) && ( iInterPolPos < iOutputWidth ) )1056 {1057 apcOutputData[uiCurPlane][iInterPolPos] = apcInputData[uiCurPlane][iPosX];1058 }1059 }1060 #endif1061 1051 } 1062 1052 } … … 1304 1294 else 1305 1295 { 1306 #if H_3D_FIX_REN1307 1296 pcAlphaData[iXPos] = pcFilledData[iXPos]; 1308 #else1309 pcAlphaData[iXPos] = REN_IS_FILLED;1310 #endif1311 1297 } 1312 1298 } -
TabularUnified trunk/source/Lib/TLibVideoIO/TVideoIOYuv.cpp ¶
r608 r655 339 339 } 340 340 341 static Bool writeField(ostream& fd, Pel* top, Pel* bottom, Bool is16bit, 342 UInt stride, 343 UInt width, UInt height, bool isTff) 344 { 345 Int write_len = width * (is16bit ? 2 : 1)*2; 346 UChar *buf = new UChar[write_len]; 347 for (Int y = 0; y < height; y++) 348 { 349 if (!is16bit) 350 { 351 for (Int x = 0; x < width; x++) 352 { 353 buf[x] = isTff ? (UChar) top[x] : (UChar) bottom[x]; 354 buf[width+x] = isTff ? (UChar) bottom[x] : (UChar) top[x]; 355 } 356 } 357 else 358 { 359 for (Int x = 0; x < width; x++) 360 { 361 buf[2*x] = isTff ? top[x] & 0xff : bottom[x] & 0xff; 362 buf[2*x+1] = isTff ? (top[x] >> 8) & 0xff : (bottom[x] >> 8) & 0xff; 363 364 buf[width+2*x] = isTff ? bottom[x] & 0xff : top[x] & 0xff; 365 buf[width+2*x+1] = isTff ? (bottom[x] >> 8) & 0xff : (top[x] >> 8) & 0xff; 366 } 367 } 368 369 fd.write(reinterpret_cast<Char*>(buf), write_len); 370 if (fd.eof() || fd.fail() ) 371 { 372 delete[] buf; 373 return false; 374 } 375 top += stride; 376 bottom += stride; 377 } 378 delete[] buf; 379 return true; 380 } 341 381 /** 342 382 * Read one Y'CbCr frame, performing any required input scaling to change … … 501 541 } 502 542 543 544 /** 545 * Write one Y'CbCr frame. No bit-depth conversion is performed, pcPicYuv is 546 * assumed to be at TVideoIO::m_fileBitdepth depth. 547 * 548 * @param pPicTop input top field YUV buffer class pointer 549 * @param pPicBottom input bottom field YUV buffer class pointer 550 * @param aiPad source padding size, aiPad[0] = horizontal, aiPad[1] = vertical 551 * @return true for success, false in case of error 552 */ 553 Bool TVideoIOYuv::write( TComPicYuv* pPicTop, TComPicYuv* pPicBottom, Int cropLeft, Int cropRight, Int cropTop, Int cropBottom , bool isTff) 554 { 555 // compute actual YUV frame size excluding padding size 556 Int iStride = pPicTop->getStride(); 557 UInt width = pPicTop->getWidth() - cropLeft - cropRight; 558 UInt height = pPicTop->getHeight() - cropTop - cropBottom; 559 Bool is16bit = m_fileBitDepthY > 8 || m_fileBitDepthC > 8; 560 561 TComPicYuv *dstPicTop = NULL; 562 TComPicYuv *dstPicBottom = NULL; 563 564 Bool retval = true; 565 566 if (m_bitDepthShiftY != 0 || m_bitDepthShiftC != 0) 567 { 568 dstPicTop = new TComPicYuv; 569 dstPicTop->create( pPicTop->getWidth(), pPicTop->getHeight(), 1, 1, 0 ); 570 pPicTop->copyToPic(dstPicTop); 571 572 dstPicBottom = new TComPicYuv; 573 dstPicBottom->create( pPicBottom->getWidth(), pPicBottom->getHeight(), 1, 1, 0 ); 574 pPicBottom->copyToPic(dstPicBottom); 575 576 Pel minvalY = 0; 577 Pel minvalC = 0; 578 Pel maxvalY = (1 << m_fileBitDepthY) - 1; 579 Pel maxvalC = (1 << m_fileBitDepthC) - 1; 580 #if CLIP_TO_709_RANGE 581 if (-m_bitDepthShiftY < 0 && m_fileBitDepthY >= 8) 582 { 583 /* ITU-R BT.709 compliant clipping for converting say 10b to 8b */ 584 minvalY = 1 << (m_fileBitDepthY - 8); 585 maxvalY = (0xff << (m_fileBitDepthY - 8)) -1; 586 } 587 if (-m_bitDepthShiftC < 0 && m_fileBitDepthC >= 8) 588 { 589 /* ITU-R BT.709 compliant clipping for converting say 10b to 8b */ 590 minvalC = 1 << (m_fileBitDepthC - 8); 591 maxvalC = (0xff << (m_fileBitDepthC - 8)) -1; 592 } 593 #endif 594 scalePlane(dstPicTop->getLumaAddr(), dstPicTop->getStride(), dstPicTop->getWidth(), dstPicTop->getHeight(), -m_bitDepthShiftY, minvalY, maxvalY); 595 scalePlane(dstPicTop->getCbAddr(), dstPicTop->getCStride(), dstPicTop->getWidth()>>1, dstPicTop->getHeight()>>1, -m_bitDepthShiftC, minvalC, maxvalC); 596 scalePlane(dstPicTop->getCrAddr(), dstPicTop->getCStride(), dstPicTop->getWidth()>>1, dstPicTop->getHeight()>>1, -m_bitDepthShiftC, minvalC, maxvalC); 597 598 scalePlane(dstPicBottom->getLumaAddr(), dstPicBottom->getStride(), dstPicBottom->getWidth(), dstPicBottom->getHeight(), -m_bitDepthShiftY, minvalY, maxvalY); 599 scalePlane(dstPicBottom->getCbAddr(), dstPicBottom->getCStride(), dstPicBottom->getWidth()>>1, dstPicBottom->getHeight()>>1, -m_bitDepthShiftC, minvalC, maxvalC); 600 scalePlane(dstPicBottom->getCrAddr(), dstPicBottom->getCStride(), dstPicBottom->getWidth()>>1, dstPicBottom->getHeight()>>1, -m_bitDepthShiftC, minvalC, maxvalC); 601 } 602 else 603 { 604 dstPicTop = pPicTop; 605 dstPicBottom = pPicBottom; 606 } 607 // location of upper left pel in a plane 608 Int planeOffset = 0; //cropLeft + cropTop * iStride; 609 //Write luma 610 if (! writeField(m_cHandle, dstPicTop->getLumaAddr() + planeOffset, dstPicBottom->getLumaAddr() + planeOffset, is16bit, iStride, width, height, isTff)) 611 { 612 retval=false; 613 goto exit; 614 } 615 616 width >>= 1; 617 height >>= 1; 618 iStride >>= 1; 619 cropLeft >>= 1; 620 cropRight >>= 1; 621 622 planeOffset = 0; // cropLeft + cropTop * iStride; 623 624 //Write chroma U 625 if (! writeField(m_cHandle, dstPicTop->getCbAddr() + planeOffset, dstPicBottom->getCbAddr() + planeOffset, is16bit, iStride, width, height, isTff)) 626 { 627 retval=false; 628 goto exit; 629 } 630 631 //Write chroma V 632 if (! writeField(m_cHandle, dstPicTop->getCrAddr() + planeOffset, dstPicBottom->getCrAddr() + planeOffset, is16bit, iStride, width, height, isTff)) 633 634 { 635 retval=false; 636 goto exit; 637 } 638 639 exit: 640 if (m_bitDepthShiftY != 0 || m_bitDepthShiftC != 0) 641 { 642 dstPicTop->destroy(); 643 delete dstPicTop; 644 dstPicBottom->destroy(); 645 delete dstPicBottom; 646 } 647 return retval; 648 } -
TabularUnified trunk/source/Lib/TLibVideoIO/TVideoIOYuv.h ¶
r608 r655 72 72 Bool read ( TComPicYuv* pPicYuv, Int aiPad[2] ); ///< read one YUV frame with padding parameter 73 73 Bool write( TComPicYuv* pPicYuv, Int confLeft=0, Int confRight=0, Int confTop=0, Int confBottom=0 ); 74 Bool write( TComPicYuv* pPicYuv, TComPicYuv* pPicYuv2, Int confLeft=0, Int confRight=0, Int confTop=0, Int confBottom=0 , bool isTff=false); 74 75 75 76 Bool isEof (); ///< check for end-of-file
Note: See TracChangeset for help on using the changeset viewer.