Changeset 1191 in 3DVCSoftware for branches/HTM-14.0-MV-draft-3/source/Lib/TLibEncoder/TEncGOP.cpp
- Timestamp:
- 15 Apr 2015, 11:36:33 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-14.0-MV-draft-3/source/Lib/TLibEncoder/TEncGOP.cpp
r1179 r1191 103 103 m_viewId = 0; 104 104 m_pocLastCoded = -1; 105 #if H_3D106 m_viewIndex = 0;107 m_isDepth = false;108 #endif109 105 #endif 110 106 #if FIX1172 … … 155 151 m_layerId = pcTEncTop->getLayerId(); 156 152 m_viewId = pcTEncTop->getViewId(); 157 #if H_3D158 m_viewIndex = pcTEncTop->getViewIndex();159 m_isDepth = pcTEncTop->getIsDepth();160 #endif161 #endif162 #if H_3D_IC163 m_aICEnableCandidate = pcTEncTop->getICEnableCandidate();164 m_aICEnableNum = pcTEncTop->getICEnableNum();165 153 #endif 166 154 #if KWU_FIX_URQ … … 656 644 pcPic ->setLayerId ( getLayerId() ); 657 645 pcPic ->setViewId ( getViewId() ); 658 #if !H_3D659 646 pcSlice->setLayerId ( getLayerId() ); 660 647 pcSlice->setViewId ( getViewId() ); 661 648 pcSlice->setVPS ( m_pcEncTop->getVPS() ); 662 #else663 pcPic ->setViewIndex ( getViewIndex() );664 pcPic ->setIsDepth( getIsDepth() );665 pcSlice->setCamparaSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() );666 #endif667 649 #endif 668 650 //set default slice level flag to the same as SPS level flag … … 880 862 881 863 TComVPS* vps = pcSlice->getVPS(); 882 #if H_3D883 Int numDirectRefLayers = vps ->getNumRefListLayers( getLayerId() );884 #else885 864 Int numDirectRefLayers = vps ->getNumDirectRefLayers( getLayerId() ); 886 #endif887 #if HHI_INTER_COMP_PRED_K0052888 pcSlice->setIvPicLists( m_ivPicLists );889 890 Int gopNum = (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid;891 GOPEntry gopEntry = m_pcCfg->getGOPEntry( gopNum );892 #else893 865 GOPEntry gopEntry = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid ); 894 #endif895 866 896 867 Bool interLayerPredLayerIdcPresentFlag = false; … … 904 875 pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 ); 905 876 } 906 #if H_3D907 if ( gopEntry.m_numActiveRefLayerPics != vps->getNumRefListLayers( getLayerId() ) )908 #else909 877 if ( gopEntry.m_numActiveRefLayerPics != vps->getNumDirectRefLayers( getLayerId() ) ) 910 #endif911 878 { 912 879 interLayerPredLayerIdcPresentFlag = true; … … 929 896 assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics ); 930 897 931 #if HHI_INTER_COMP_PRED_K0052932 #if H_3D933 if ( m_pcEncTop->decProcAnnexI() )934 {935 pcSlice->deriveInCmpPredAndCpAvailFlag();936 if ( pcSlice->getInCmpPredAvailFlag() )937 {938 pcSlice->setInCompPredFlag( gopEntry.m_interCompPredFlag );939 }940 else941 {942 if (gopEntry.m_interCompPredFlag )943 {944 if ( gopNum == MAX_GOP)945 {946 printf( "\nError: FrameI_l%d cannot enable inter-component prediction.\n", pcSlice->getVPS()->getLayerIdInVps( getLayerId() ) );947 }948 else949 {950 printf( "\nError: Frame%d_l%d cannot enable inter-component prediction.\n", gopNum, pcSlice->getVPS()->getLayerIdInVps( getLayerId() ) );951 }952 953 exit(EXIT_FAILURE);954 }955 }956 pcSlice->init3dToolParameters();957 pcSlice->checkInCompPredRefLayers();958 }959 960 961 // This needs to be done after initilizaiton of 3D tool parameters.962 pcSlice->setMaxNumMergeCand ( m_pcCfg->getMaxNumMergeCand() + ( ( pcSlice->getMpiFlag( ) || pcSlice->getIvMvPredFlag( ) || pcSlice->getViewSynthesisPredFlag( ) ) ? 1 : 0 ));963 #endif964 #endif965 898 966 899 pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); … … 991 924 pcSlice->setRefPicList ( rcListPic ); 992 925 #endif 993 #if H_3D994 pcSlice->setDefaultRefView();995 #endif996 #if H_3D_ARP997 //GT: This seems to be broken when layerId in vps is not equal to layerId in nuh998 pcSlice->setARPStepNum(m_ivPicLists);999 if(pcSlice->getARPStepNum() > 1)1000 {1001 for(Int iLayerId = 0; iLayerId < getLayerId(); iLayerId ++ )1002 {1003 Int iViewIdx = pcSlice->getVPS()->getViewIndex(iLayerId);1004 Bool bIsDepth = ( pcSlice->getVPS()->getDepthId ( iLayerId ) == 1 );1005 if( iViewIdx<getViewIndex() && !bIsDepth )1006 {1007 pcSlice->setBaseViewRefPicList( m_ivPicLists->getPicList( iLayerId ), iViewIdx );1008 }1009 }1010 }1011 #endif1012 #if !HHI_INTER_COMP_PRED_K00521013 #if H_3D1014 pcSlice->setIvPicLists( m_ivPicLists );1015 #if H_3D_IV_MERGE1016 assert( !m_pcEncTop->getIsDepth() || ( pcSlice->getTexturePic() != 0 ) );1017 #endif1018 #endif1019 #endif1020 #if H_3D_IC1021 pcSlice->setICEnableCandidate( m_aICEnableCandidate );1022 pcSlice->setICEnableNum( m_aICEnableNum );1023 #endif1024 926 // Slice info. refinement 1025 927 #if H_MV … … 1072 974 1073 975 pcSlice->setList1IdxToList0Idx(); 1074 #if H_3D_TMVP1075 if(pcSlice->getLayerId())1076 pcSlice->generateAlterRefforTMVP();1077 #endif1078 976 if (m_pcEncTop->getTMVPModeId() == 2) 1079 977 { … … 1106 1004 #endif 1107 1005 1108 #if H_3D_VSO1109 // Should be moved to TEncTop !!!1110 Bool bUseVSO = m_pcEncTop->getUseVSO();1111 1112 TComRdCost* pcRdCost = m_pcEncTop->getRdCost();1113 1114 pcRdCost->setUseVSO( bUseVSO );1115 1116 // SAIT_VSO_EST_A00331117 pcRdCost->setUseEstimatedVSD( m_pcEncTop->getUseEstimatedVSD() );1118 1119 if ( bUseVSO )1120 {1121 Int iVSOMode = m_pcEncTop->getVSOMode();1122 pcRdCost->setVSOMode( iVSOMode );1123 pcRdCost->setAllowNegDist( m_pcEncTop->getAllowNegDist() );1124 1125 // SAIT_VSO_EST_A00331126 #if H_3D_FCO1127 Bool flagRec;1128 flagRec = ((m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), false, pcSlice->getPOC(), true) == NULL) ? false: true);1129 pcRdCost->setVideoRecPicYuv( m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), false, pcSlice->getPOC(), flagRec ) );1130 pcRdCost->setDepthPicYuv ( m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), true, pcSlice->getPOC(), false ) );1131 #else1132 pcRdCost->setVideoRecPicYuv( m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), false , pcSlice->getPOC(), true ) );1133 pcRdCost->setDepthPicYuv ( m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), true , pcSlice->getPOC(), false ) );1134 #endif1135 1136 // LGE_WVSO_A01191137 Bool bUseWVSO = m_pcEncTop->getUseWVSO();1138 pcRdCost->setUseWVSO( bUseWVSO );1139 1140 }1141 #endif1142 1006 /////////////////////////////////////////////////////////////////////////////////////////////////// Compress a slice 1143 1007 // Slice compression … … 1312 1176 m_storedStartCUAddrForEncodingSliceSegment.push_back(nextCUAddr); 1313 1177 startCUAddrSliceSegmentIdx++; 1314 #if H_3D_NBDV 1315 if(pcSlice->getViewIndex() && !pcSlice->getIsDepth()) //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. 1316 { 1317 Int iColPoc = pcSlice->getRefPOC(RefPicList(1-pcSlice->getColFromL0Flag()), pcSlice->getColRefIdx()); 1318 pcPic->setNumDdvCandPics(pcPic->getDisCandRefPictures(iColPoc)); 1319 } 1320 #endif 1321 #if H_3D 1322 pcSlice->setDepthToDisparityLUTs(); 1323 1324 #endif 1325 1326 #if H_3D_NBDV 1327 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. 1328 { 1329 pcPic->checkTemporalIVRef(); 1330 } 1331 1332 if(pcSlice->getIsDepth()) 1333 { 1334 pcPic->checkTextureRef(); 1335 } 1336 #endif 1178 1337 1179 while(nextCUAddr<uiRealEndAddress) // determine slice boundaries 1338 1180 { … … 1467 1309 nalu = NALUnit(NAL_UNIT_PPS); 1468 1310 #endif 1469 #if PPS_FIX_DEPTH1470 if(!pcSlice->getIsDepth() || !pcSlice->getViewIndex() )1471 {1472 #endif1473 1311 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 1474 1312 m_pcEntropyCoder->encodePPS(pcSlice->getPPS()); … … 1477 1315 actualTotalBits += UInt(accessUnit.back()->m_nalUnitData.str().size()) * 8; 1478 1316 1479 #if PPS_FIX_DEPTH1480 }1481 #endif1482 1317 xCreateLeadingSEIMessages(accessUnit, pcSlice->getSPS()); 1483 1318 … … 1994 1829 m_pcSAO->PCMLFDisableProcess(pcPic); 1995 1830 1996 #if H_3D_DISABLE_CHROMA1997 if (pcSlice->getIsDepth())1998 {1999 sliceEnabled[SAO_Cb] = false;2000 sliceEnabled[SAO_Cr] = false;2001 }2002 #endif2003 1831 //assign SAO slice header 2004 1832 for(Int s=0; s< uiNumSlices; s++) … … 2020 1848 } 2021 1849 } // end iteration over slices 2022 #if H_3D2023 pcPic->compressMotion(2);2024 #endif2025 #if !H_3D2026 1850 pcPic->compressMotion(); 2027 #endif2028 1851 #if H_MV 2029 1852 m_pocLastCoded = pcPic->getPOC(); … … 2444 2267 } 2445 2268 #endif 2446 #if H_3D_VSO2447 Void TEncGOP::preLoopFilterPicAll( TComPic* pcPic, Dist64& ruiDist, UInt64& ruiBits )2448 #else2449 2269 Void TEncGOP::preLoopFilterPicAll( TComPic* pcPic, UInt64& ruiDist, UInt64& ruiBits ) 2450 #endif2451 2270 { 2452 2271 TComSlice* pcSlice = pcPic->getSlice(pcPic->getCurrSliceIdx()); … … 2546 2365 } 2547 2366 2548 #if H_3D_VSO2549 Dist64 TEncGOP::xFindDistortionFrame (TComPicYuv* pcPic0, TComPicYuv* pcPic1)2550 #else2551 2367 UInt64 TEncGOP::xFindDistortionFrame (TComPicYuv* pcPic0, TComPicYuv* pcPic1) 2552 #endif2553 2368 { 2554 2369 Int x, y; … … 2562 2377 Int iHeight = pcPic0->getHeight(); 2563 2378 2564 #if H_3D_VSO2565 Dist64 uiTotalDiff = 0;2566 #else2567 2379 UInt64 uiTotalDiff = 0; 2568 #endif2569 2380 2570 2381 for( y = 0; y < iHeight; y++ ) … … 2682 2493 } 2683 2494 2684 #if H_3D_VSO2685 #if H_3D_VSO_SYNTH_DIST_OUT2686 if ( m_pcRdCost->getUseRenModel() )2687 {2688 unsigned int maxval = 255 * (1<<(g_uiBitDepth + g_uiBitIncrement -8));2689 Double fRefValueY = (double) maxval * maxval * iSize;2690 Double fRefValueC = fRefValueY / 4.0;2691 TRenModel* pcRenModel = m_pcEncTop->getEncTop()->getRenModel();2692 Int64 iDistVSOY, iDistVSOU, iDistVSOV;2693 pcRenModel->getTotalSSE( iDistVSOY, iDistVSOU, iDistVSOV );2694 dYPSNR = ( iDistVSOY ? 10.0 * log10( fRefValueY / (Double) iDistVSOY ) : 99.99 );2695 dUPSNR = ( iDistVSOU ? 10.0 * log10( fRefValueC / (Double) iDistVSOU ) : 99.99 );2696 dVPSNR = ( iDistVSOV ? 10.0 * log10( fRefValueC / (Double) iDistVSOV ) : 99.99 );2697 }2698 else2699 {2700 #endif2701 #endif2702 2495 iHeight >>= 1; 2703 2496 iWidth >>= 1; … … 2738 2531 dUPSNR = ( uiSSDU ? 10.0 * log10( fRefValueC / (Double)uiSSDU ) : 99.99 ); 2739 2532 dVPSNR = ( uiSSDV ? 10.0 * log10( fRefValueC / (Double)uiSSDV ) : 99.99 ); 2740 #if H_3D_VSO2741 #if H_3D_VSO_SYNTH_DIST_OUT2742 }2743 #endif2744 #endif2745 2533 /* calculate the size of the access unit, excluding: 2746 2534 * - any AnnexB contributions (start_code_prefix, zero_byte, etc.,)
Note: See TracChangeset for help on using the changeset viewer.