Changeset 531 in 3DVCSoftware for branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncTop.cpp
- Timestamp:
- 11 Jul 2013, 16:03:14 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncTop.cpp
r504 r531 120 120 xSetDirectDependencyFlags( vps ); 121 121 #if H_3D 122 #if H_3D_DIM 123 for( Int layer = 0; layer < m_numberOfLayers; layer++ ) 124 { 125 vps.setVpsDepthModesFlag( layer, ((vps.getDepthId( layer ) != 0) && (m_useDMM || m_useRBC || m_useSDC || m_useDLT)) ? true : false ); 126 #if H_3D_DIM_DLT 127 vps.setUseDLTFlag( layer , ((vps.getDepthId( layer ) != 0) && m_useDLT) ? true : false ); 128 if( vps.getUseDLTFlag( layer ) ) 129 { 130 xAnalyzeInputBaseDepth(layer, max(m_iIntraPeriod, 24), &vps); 131 } 132 #endif 133 } 134 #endif 122 135 vps.initViewIndex(); 123 136 #if H_3D_GEN … … 184 197 #if H_3D_IC 185 198 m_cTEncTop.setUseIC ( vps.getViewIndex( layer ) == 0 ? false : m_abUseIC[isDepth ? 1 : 0] ); 199 #endif 200 //========== Depth intra modes ========== 201 #if H_3D_DIM 202 m_cTEncTop.setUseDMM ( isDepth ? m_useDMM : false ); 203 m_cTEncTop.setUseRBC ( isDepth ? m_useRBC : false ); 204 m_cTEncTop.setUseSDC ( isDepth ? m_useSDC : false ); 205 m_cTEncTop.setUseDLT ( isDepth ? m_useDLT : false ); 186 206 #endif 187 207 #endif // H_3D … … 562 582 // initialize global variables 563 583 initROM(); 584 #if H_3D_DIM_DMM 585 initWedgeLists( true ); 586 #endif 564 587 565 588 for( Int layer=0; layer < m_numberOfLayers; layer++) … … 989 1012 } 990 1013 1014 #if H_3D_DIM_DLT 1015 Void TAppEncTop::xAnalyzeInputBaseDepth(UInt layer, UInt uiNumFrames, TComVPS* vps) 1016 { 1017 TComPicYuv* pcDepthPicYuvOrg = new TComPicYuv; 1018 // allocate original YUV buffer 1019 pcDepthPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 1020 1021 TVideoIOYuv* depthVideoFile = new TVideoIOYuv; 1022 1023 UInt uiMaxDepthValue = ((1 << g_bitDepthY)-1); 1024 1025 Bool abValidDepths[256]; 1026 1027 depthVideoFile->open( m_pchInputFileList[layer], false, m_inputBitDepthY, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC ); // read mode 1028 1029 // initialize boolean array 1030 for(Int p=0; p<=uiMaxDepthValue; p++) 1031 abValidDepths[p] = false; 1032 1033 Int iHeight = pcDepthPicYuvOrg->getHeight(); 1034 Int iWidth = pcDepthPicYuvOrg->getWidth(); 1035 Int iStride = pcDepthPicYuvOrg->getStride(); 1036 1037 Pel* pInDM = pcDepthPicYuvOrg->getLumaAddr(); 1038 1039 for(Int uiFrame=0; uiFrame < uiNumFrames; uiFrame++ ) 1040 { 1041 depthVideoFile->read( pcDepthPicYuvOrg, m_aiPad ); 1042 1043 // check all pixel values 1044 for (Int i=0; i<iHeight; i++) 1045 { 1046 Int rowOffset = i*iStride; 1047 1048 for (Int j=0; j<iWidth; j++) 1049 { 1050 Pel depthValue = pInDM[rowOffset+j]; 1051 abValidDepths[depthValue] = true; 1052 } 1053 } 1054 } 1055 1056 depthVideoFile->close(); 1057 1058 pcDepthPicYuvOrg->destroy(); 1059 delete pcDepthPicYuvOrg; 1060 1061 // convert boolean array to idx2Depth LUT 1062 Int* aiIdx2DepthValue = (Int*) calloc(uiMaxDepthValue, sizeof(Int)); 1063 Int iNumDepthValues = 0; 1064 for(Int p=0; p<=uiMaxDepthValue; p++) 1065 { 1066 if( abValidDepths[p] == true) 1067 { 1068 aiIdx2DepthValue[iNumDepthValues++] = p; 1069 } 1070 } 1071 1072 if( uiNumFrames == 0 || numBitsForValue(iNumDepthValues) == g_bitDepthY ) 1073 { 1074 // don't use DLT 1075 vps->setUseDLTFlag(layer, false); 1076 } 1077 1078 // assign LUT 1079 if( vps->getUseDLTFlag(layer) ) 1080 vps->setDepthLUTs(layer, aiIdx2DepthValue, iNumDepthValues); 1081 1082 // free temporary memory 1083 free(aiIdx2DepthValue); 1084 } 1085 #endif 1086 991 1087 #if H_MV 992 1088 Void TAppEncTop::xSetDimensionIdAndLength( TComVPS& vps )
Note: See TracChangeset for help on using the changeset viewer.