Changeset 210 in 3DVCSoftware for trunk/source/App/TAppEncoder
- Timestamp:
- 11 Dec 2012, 18:52:43 (12 years ago)
- Location:
- trunk/source/App/TAppEncoder
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/App/TAppEncoder/TAppEncCfg.cpp
r189 r210 111 111 if (m_pchBitstreamFile != NULL) 112 112 free (m_pchBitstreamFile) ; 113 #if FLEX_CODING_ORDER_M23723 114 if (m_pchMVCJointCodingOrder != NULL) 115 { 116 free(m_pchMVCJointCodingOrder) ; 117 } 118 #endif 113 119 #if HHI_VSO 114 120 if ( m_pchVSOConfig != NULL) … … 203 209 string cfg_RowHeight; 204 210 string cfg_ScalingListFile; 211 212 #if FLEX_CODING_ORDER_M23723 213 string cfg_JointCodingOrdering; 214 #endif 215 205 216 po::Options opts; 206 217 opts.addOptions() … … 246 257 247 258 ("NumberOfViews", m_iNumberOfViews, 0, "Number of views") 259 #if FLEX_CODING_ORDER_M23723 260 ("FCO", m_b3DVFlexOrder, false, "flexible coding order flag" ) 261 ("FCOCodingOrder", cfg_JointCodingOrdering, string(""), "The coding order for joint texture-depth coding") 262 #endif 248 263 /* Unit definition parameters */ 249 264 ("MaxCUWidth", m_uiMaxCUWidth, 64u) … … 276 291 ("FastSearch", m_iFastSearch, 1, "0:Full search 1:Diamond 2:PMVFAST") 277 292 ("SearchRange,-sr",m_iSearchRange, 96, "motion search range") 293 #if DV_V_RESTRICTION_B0037 294 ("DisparitySearchRangeRestriction",m_bUseDisparitySearchRangeRestriction, false, "restrict disparity search range") 295 ("VerticalDisparitySearchRange",m_iVerticalDisparitySearchRange, 56, "vertical disparity search range") 296 #endif 278 297 ("BipredSearchRange", m_bipredSearchRange, 4, "motion search range for bipred refinement") 279 298 ("HadamardME", m_bUseHADME, true, "hadamard ME for fractional-pel") … … 329 348 /* Camera Paremetes */ 330 349 ("CameraParameterFile,cpf", m_pchCameraParameterFile, (Char *) 0, "Camera Parameter File Name") 350 #if QC_MVHEVC_B0046 351 ("BaseViewCameraNumbers" , m_aiVId, std::vector<Int>(1, MAX_VIEW_NUM), "Numbers of base views") 352 #endif 331 353 ("BaseViewCameraNumbers" , m_pchBaseViewCameraNumbers, (Char *) 0, "Numbers of base views") 332 354 … … 526 548 m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str()); 527 549 m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str()); 528 550 #if FLEX_CODING_ORDER_M23723 551 m_pchMVCJointCodingOrder= cfg_JointCodingOrdering.empty()?NULL:strdup(cfg_JointCodingOrdering.c_str()); 552 // If flexible order is enabled and if depth comes before the texture for a view, disable VSO 553 #if HHI_VSO && DISABLE_FCO_FOR_VSO 554 Bool depthComesFirst = false; 555 int iter = 0; 556 if ( m_b3DVFlexOrder ) 557 { 558 for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++) 559 { 560 iter = 0; 561 for ( Int ii=1; ii<12; ii+=2 ) 562 { 563 Int iViewIdxCfg = (Int)(m_pchMVCJointCodingOrder[ii]-'0'); 564 if ( iViewIdxCfg == iViewIdx ) 565 { 566 iter ++; 567 if ( m_pchMVCJointCodingOrder[ii-1]=='D' ) // depth comes first for this view 568 { 569 if(iter == 1) 570 { 571 depthComesFirst = true; 572 break; 573 } 574 } 575 else 576 { 577 assert(m_pchMVCJointCodingOrder[ii-1]=='T'); 578 } 579 } 580 } 581 } 582 } 583 if (depthComesFirst) 584 { 585 m_bUseVSO = false; 586 } 587 #endif 588 #endif 529 589 m_pchColumnWidth = cfg_ColumnWidth.empty() ? NULL: strdup(cfg_ColumnWidth.c_str()); 530 590 m_pchRowHeight = cfg_RowHeight.empty() ? NULL : strdup(cfg_RowHeight.c_str()); … … 786 846 } 787 847 #else 848 #if !QC_MVHEVC_B0046 788 849 m_cCameraData .init ( (UInt)m_iNumberOfViews, 789 850 m_uiInputBitDepth, … … 797 858 LOG2_DISP_PREC_LUT ); 798 859 #endif 860 #endif 799 861 800 862 801 863 // check validity of input parameters 802 864 xCheckParameter(); 865 #if !QC_MVHEVC_B0046 803 866 m_cCameraData.check( false, true ); 804 867 #endif 805 868 // print-out parameters 806 869 xPrintParameter(); … … 850 913 xConfirmPara( m_iFastSearch < 0 || m_iFastSearch > 2, "Fast Search Mode is not supported value (0:Full search 1:Diamond 2:PMVFAST)" ); 851 914 xConfirmPara( m_iSearchRange < 0 , "Search Range must be more than 0" ); 915 #if DV_V_RESTRICTION_B0037 916 xConfirmPara( m_iVerticalDisparitySearchRange <= 0 , "Vertical Disparity Search Range must be more than 0" ); 917 #endif 852 918 xConfirmPara( m_bipredSearchRange < 0 , "Search Range must be more than 0" ); 853 919 xConfirmPara( m_iMaxDeltaQP > 7, "Absolute Delta QP exceeds supported range (0 to 7)" ); … … 1595 1661 printf("Min PCM size : %d\n", 1 << m_uiPCMLog2MinSize); 1596 1662 printf("Motion search range : %d\n", m_iSearchRange ); 1663 #if DV_V_RESTRICTION_B0037 1664 printf("Disp search range restriction: %d\n", m_bUseDisparitySearchRangeRestriction ); 1665 printf("Vertical disp search range : %d\n", m_iVerticalDisparitySearchRange ); 1666 #endif 1597 1667 printf("Intra period : %d\n", m_iIntraPeriod ); 1598 1668 printf("Decoding refresh type : %d\n", m_iDecodingRefreshType ); … … 1745 1815 #if TMVP_DEPTH_SWITCH 1746 1816 printf("TMVP:%d ", (m_enableTMVP[1] ? 1 : 0) ); 1817 #endif 1818 #if FLEX_CODING_ORDER_M23723 1819 printf("FCO:%d ", (m_b3DVFlexOrder ? 1: 0)); 1820 1821 if(m_b3DVFlexOrder) 1822 { 1823 printf("CodingOrder: %s ", m_pchMVCJointCodingOrder); 1824 } 1747 1825 #endif 1748 1826 #if HHI_VSO -
trunk/source/App/TAppEncoder/TAppEncCfg.h
r189 r210 88 88 Int m_iNumberOfViews; ///< number Views to Encode 89 89 Bool m_bUsingDepthMaps; 90 91 #if FLEX_CODING_ORDER_M23723 92 Char* m_pchMVCJointCodingOrder; ///< texture-depth coding order 93 Bool m_b3DVFlexOrder; ///< flexible coding order flag 94 #endif 95 90 96 // coding structure 91 97 Int m_iIntraPeriod; ///< period of I-slice (random access period) … … 109 115 std::vector<Double> m_adQP; ///< QP value of key-picture (floating point) [0] video, [1] depth 110 116 std::vector<Int> m_aiQP; ///< QP value of key-picture (integer) [0] video, [1] depth 117 #if QC_MVHEVC_B0046 118 std::vector<Int> m_aiVId; ///< view id 119 #endif 111 120 Int m_aiTLayerQPOffset[MAX_TLAYER]; ///< QP offset corresponding to temporal layer depth 112 121 char* m_pchdQPFile; ///< QP offset for each slice (initialized from external file) … … 200 209 Int m_iFastSearch; ///< ME mode, 0 = full, 1 = diamond, 2 = PMVFAST 201 210 Int m_iSearchRange; ///< ME search range 211 #if DV_V_RESTRICTION_B0037 212 Bool m_bUseDisparitySearchRangeRestriction; ///< restrict vertical search range for inter-view prediction 213 Int m_iVerticalDisparitySearchRange; ///< ME vertical search range for inter-view prediction 214 #endif 202 215 Int m_bipredSearchRange; ///< ME search range for bipred refinement 203 216 Bool m_bUseFastEnc; ///< flag for using fast encoder setting … … 285 298 Char* m_pchCameraParameterFile; ///< camera parameter file 286 299 Char* m_pchBaseViewCameraNumbers; 300 #if !QC_MVHEVC_B0046 287 301 TAppComCamPara m_cCameraData; 288 302 #endif 289 303 Int m_iCodedCamParPrecision; ///< precision for coding of camera parameters 290 304 -
trunk/source/App/TAppEncoder/TAppEncTop.cpp
r189 r210 67 67 Void TAppEncTop::xInitLibCfg() 68 68 { 69 #if VIDYO_VPS_INTEGRATION 69 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 70 #if !QC_MVHEVC_B0046 70 71 UInt layerId = 0; 72 #endif 71 73 // TODO: fix the assumption here that the temporal structures are all equal across all layers??? 72 74 m_cVPS.setMaxTLayers( m_maxTempLayer[0] ); 75 #if QC_MVHEVC_B0046 76 m_cVPS.setMaxLayers( m_iNumberOfViews ); 77 #else 73 78 m_cVPS.setMaxLayers( m_iNumberOfViews * (m_bUsingDepthMaps ? 2:1) ); 79 #endif 74 80 for(Int i = 0; i < MAX_TLAYER; i++) 75 81 { … … 101 107 m_acTEncTopList[iViewIdx]->setViewId ( iViewIdx ); 102 108 m_acTEncTopList[iViewIdx]->setIsDepth ( false ); 109 #if QC_MVHEVC_B0046 110 m_acTEncTopList[iViewIdx]->setLayerId ( iViewIdx ); 111 m_cVPS.setViewId ( m_aiVId[ iViewIdx ], iViewIdx ); 112 #else 103 113 m_acTEncTopList[iViewIdx]->setViewOrderIdx ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] ); 104 114 #if VIDYO_VPS_INTEGRATION … … 117 127 m_acTEncTopList[iViewIdx]->setCodedScale ( m_cCameraData.getCodedScale () ); 118 128 m_acTEncTopList[iViewIdx]->setCodedOffset ( m_cCameraData.getCodedOffset () ); 129 #endif 119 130 120 131 //====== Coding Structure ======== … … 170 181 m_acTEncTopList[iViewIdx]->setSearchRange ( m_iSearchRange ); 171 182 m_acTEncTopList[iViewIdx]->setBipredSearchRange ( m_bipredSearchRange ); 172 183 #if DV_V_RESTRICTION_B0037 184 m_acTEncTopList[iViewIdx]->setUseDisparitySearchRangeRestriction ( m_bUseDisparitySearchRangeRestriction ); 185 m_acTEncTopList[iViewIdx]->setVerticalDisparitySearchRange( m_iVerticalDisparitySearchRange ); 186 #endif 173 187 //====== Quality control ======== 174 188 m_acTEncTopList[iViewIdx]->setMaxDeltaQP ( m_iMaxDeltaQP ); … … 386 400 for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++) 387 401 { 402 403 #if FLEX_CODING_ORDER_M23723 404 // Detect whether depth comes before than texture for this view 405 Bool isDepthFirst = false; 406 if ( m_b3DVFlexOrder ) 407 { 408 for ( Int ii=1; ii<12; ii+=2 ) 409 { 410 Int iViewIdxCfg = (Int)(m_pchMVCJointCodingOrder[ii]-'0'); 411 if ( iViewIdxCfg == iViewIdx ) 412 { 413 if ( m_pchMVCJointCodingOrder[ii-1]=='D' ) // depth comes first for this view 414 { 415 isDepthFirst = true; 416 } 417 else 418 { 419 assert(m_pchMVCJointCodingOrder[ii-1]=='T'); 420 } 421 break; 422 } 423 } 424 } 425 #endif 426 388 427 m_depthFrameRcvd.push_back(0); 389 428 m_acTEncDepthTopList.push_back(new TEncTop); … … 406 445 m_acTEncDepthTopList[iViewIdx]->setViewId ( iViewIdx ); 407 446 m_acTEncDepthTopList[iViewIdx]->setIsDepth ( true ); 447 #if QC_MVHEVC_B0046 448 m_acTEncDepthTopList[iViewIdx]->setLayerId ( iViewIdx ); 449 #else 408 450 m_acTEncDepthTopList[iViewIdx]->setViewOrderIdx ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] ); 451 #endif 409 452 #if VIDYO_VPS_INTEGRATION 410 453 layerId = iViewIdx * 2 + 1; … … 473 516 m_acTEncDepthTopList[iViewIdx]->setSearchRange ( m_iSearchRange ); 474 517 m_acTEncDepthTopList[iViewIdx]->setBipredSearchRange ( m_bipredSearchRange ); 475 518 #if DV_V_RESTRICTION_B0037 519 m_acTEncDepthTopList[iViewIdx]->setUseDisparitySearchRangeRestriction ( m_bUseDisparitySearchRangeRestriction ); 520 m_acTEncDepthTopList[iViewIdx]->setVerticalDisparitySearchRange( m_iVerticalDisparitySearchRange ); 521 #endif 476 522 //====== Quality control ======== 477 523 m_acTEncDepthTopList[iViewIdx]->setMaxDeltaQP ( m_iMaxDeltaQP ); … … 661 707 m_acTEncDepthTopList[iViewIdx]->setUseDMM ( m_bUseDMM ); 662 708 #endif 709 #if FLEX_CODING_ORDER_M23723 && HHI_DMM_PRED_TEX 710 m_acTEncDepthTopList[iViewIdx]->setUseDMM34( (m_b3DVFlexOrder && isDepthFirst) ? false : m_bUseDMM ); 711 #endif 712 663 713 #if OL_QTLIMIT_PREDCODING_B0068 664 714 m_acTEncDepthTopList[iViewIdx]->setUseQTLPC (m_bUseQTLPC); 665 715 #endif 666 716 #if HHI_MPI 717 #if FLEX_CODING_ORDER_M23723 718 m_acTEncDepthTopList[iViewIdx]->setUseMVI( (m_b3DVFlexOrder && isDepthFirst) ? false : m_bUseMVI ); 719 #else 667 720 m_acTEncDepthTopList[iViewIdx]->setUseMVI( m_bUseMVI ); 721 #endif 668 722 #endif 669 723 #if RWTH_SDC_DLT_B0036 … … 821 875 { 822 876 m_acTEncTopList[iViewIdx]->init( this ); 877 #if QC_MVHEVC_B0046 878 //set setNumDirectRefLayer 879 Int iNumDirectRef = m_acTEncTopList[iViewIdx]->getSPS()->getNumberOfUsableInterViewRefs(); 880 m_acTEncTopList[iViewIdx]->getEncTop()->getVPS()->setNumDirectRefLayer(iNumDirectRef, iViewIdx); 881 for(Int iNumIvRef = 0; iNumIvRef < iNumDirectRef; iNumIvRef ++) 882 { 883 Int iLayerId = m_acTEncTopList[iViewIdx]->getSPS()->getUsableInterViewRef(iNumIvRef); 884 m_acTEncTopList[iViewIdx]->getEncTop()->getVPS()->setDirectRefLayerId( iLayerId + iViewIdx, iViewIdx, iNumIvRef); 885 } 886 #endif 823 887 } 824 888 for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++) … … 862 926 TComPicYuv* pcPicYuvOrg = new TComPicYuv; 863 927 TComPicYuv* pcDepthPicYuvOrg = new TComPicYuv; 928 #if !QC_MVHEVC_B0046 864 929 TComPicYuv* pcPdmDepthOrg = new TComPicYuv; 930 #endif 865 931 TComPicYuv* pcPicYuvRec = NULL; 866 932 TComPicYuv* pcDepthPicYuvRec = NULL; … … 963 1029 { 964 1030 Int iNumEncoded = 0; 1031 #if !QC_MVHEVC_B0046 965 1032 UInt iNextPoc = m_acTEncTopList[0] -> getFrameId( gopId ); 966 1033 if ( iNextPoc < m_iFrameToBeEncoded ) … … 968 1035 m_cCameraData.update( iNextPoc ); 969 1036 } 1037 #endif 1038 1039 #if FLEX_CODING_ORDER_M23723 1040 if (m_b3DVFlexOrder) 1041 { 1042 Int iNumDepthEncoded = 0; 1043 iNumEncoded = 0; 1044 Int i=0; 1045 Int iViewIdx=0; 1046 Int iNumberofDepthViews = m_bUsingDepthMaps?m_iNumberOfViews:0; 1047 for (Int j=0; j < (m_iNumberOfViews+ iNumberofDepthViews); j++ ) 1048 { 1049 if (m_pchMVCJointCodingOrder[i]=='T') 1050 { 1051 1052 i++; 1053 assert(isdigit(m_pchMVCJointCodingOrder[i])); 1054 iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0'); 1055 1056 m_acTEncTopList[iViewIdx]->encode( eos[iViewIdx], pcPicYuvOrg, *m_picYuvRec[iViewIdx], outputAccessUnits, iNumEncoded, gopId ); 1057 xWriteOutput(bitstreamFile, iNumEncoded, outputAccessUnits, iViewIdx, false); 1058 outputAccessUnits.clear(); 1059 i++; 1060 } 1061 else if ( m_pchMVCJointCodingOrder[i] == 'D') 1062 { 1063 1064 i++; 1065 if( m_bUsingDepthMaps ) 1066 { 1067 assert(isdigit(m_pchMVCJointCodingOrder[i])); 1068 iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0'); 1069 #if SAIT_VSO_EST_A0033 1070 if( m_bUseVSO && iNextPoc < m_iFrameToBeEncoded ) 1071 { 1072 m_cCameraData.xSetDispCoeff( iNextPoc, iViewIdx ); 1073 m_acTEncDepthTopList[iViewIdx]->setDispCoeff( m_cCameraData.getDispCoeff() ); 1074 } 1075 #endif 1076 m_acTEncDepthTopList[iViewIdx]->encode( depthEos[iViewIdx], pcDepthPicYuvOrg, *m_picYuvDepthRec[iViewIdx], outputAccessUnits, iNumDepthEncoded, gopId ); 1077 xWriteOutput(bitstreamFile, iNumDepthEncoded, outputAccessUnits, iViewIdx, true); 1078 outputAccessUnits.clear(); 1079 i++; 1080 } 1081 } 1082 } 1083 } 1084 else 1085 { 1086 1087 #endif 970 1088 for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ ) 971 1089 { … … 991 1109 } 992 1110 } 1111 1112 #if FLEX_CODING_ORDER_M23723 1113 } 1114 #endif 1115 993 1116 #if HHI_INTERVIEW_SKIP || HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED 994 1117 for( Int iViewIdx = 0; iViewIdx < m_iNumberOfViews; iViewIdx++ ) … … 1023 1146 pcDepthPicYuvOrg = NULL; 1024 1147 1148 #if !QC_MVHEVC_B0046 1149 #if FIX_DEL_NULLPTR 1150 if ( pcPdmDepthOrg != NULL && m_uiMultiviewMvRegMode ) 1151 #else 1025 1152 if ( pcPdmDepthOrg != NULL ) 1153 #endif 1026 1154 { 1027 1155 pcPdmDepthOrg->destroy(); … … 1029 1157 pcPdmDepthOrg = NULL; 1030 1158 }; 1031 1159 #endif 1032 1160 1033 1161 for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ ) … … 1233 1361 case NAL_UNIT_CODED_SLICE: 1234 1362 #if H0566_TLA 1363 #if !QC_REM_IDV_B0046 1235 1364 case NAL_UNIT_CODED_SLICE_IDV: 1365 #endif 1236 1366 case NAL_UNIT_CODED_SLICE_TLA: 1237 1367 case NAL_UNIT_CODED_SLICE_CRA: -
trunk/source/App/TAppEncoder/TAppEncTop.h
r189 r210 87 87 #endif 88 88 89 #if VIDYO_VPS_INTEGRATION 89 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 90 90 TComVPS m_cVPS; 91 91 #endif … … 139 139 #endif 140 140 141 #if QC_MVHEVC_B0046 142 TComVPS* getVPS() { return &m_cVPS; } 143 #endif 141 144 #if VIDYO_VPS_INTEGRATION 142 145 TComVPS* getVPS() { return &m_cVPS; }
Note: See TracChangeset for help on using the changeset viewer.