Changeset 1534 in SHVCSoftware for branches/SHM-dev/source/App
- Timestamp:
- 22 Mar 2016, 19:58:32 (9 years ago)
- Location:
- branches/SHM-dev/source/App/TAppEncoder
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r1532 r1534 713 713 Int* cfg_auxId[MAX_LAYERS]; 714 714 #endif 715 #if VIEW_SCALABILITY 716 Int* cfg_viewOrderIndex [MAX_LAYERS]; 717 Int* cfg_viewId [MAX_LAYERS]; 718 #endif 715 719 716 720 Int* cfg_numSamplePredRefLayers [MAX_LAYERS]; … … 889 893 cfg_auxId[layer] = &m_apcLayerCfg[layer]->m_auxId; 890 894 #endif 895 #if VIEW_SCALABILITY 896 cfg_viewOrderIndex[layer] = &m_apcLayerCfg[layer]->m_viewOrderIndex; 897 cfg_viewId[layer] = &m_apcLayerCfg[layer]->m_viewId; 898 #endif 891 899 cfg_layerSwitchOffBegin[layer] = &m_apcLayerCfg[layer]->m_layerSwitchOffBegin; 892 900 cfg_layerSwitchOffEnd[layer] = &m_apcLayerCfg[layer]->m_layerSwitchOffEnd; … … 1043 1051 #if AUXILIARY_PICTURES 1044 1052 ("AuxId%d", cfg_auxId, 0, m_numLayers, "Auxilary picture ID for layer %d (0: Not aux pic, 1: Alpha plane, 2: Depth picture, 3: Cb enh, 4: Cr enh") 1053 #endif 1054 #if VIEW_SCALABILITY 1055 ("ViewOrderIndex%d", cfg_viewOrderIndex, -1, m_numLayers, "View Order Index per layer") 1056 ("ViewId%d", cfg_viewId, -1, m_numLayers, "View Id per View Order Index") 1045 1057 #endif 1046 1058 ("ConformanceMode%d", cfg_conformanceMode, 0, m_numLayers, "Window conformance mode (0: no cropping, 1:automatic padding, 2: padding, 3:cropping") … … 3021 3033 // check validity of input parameters 3022 3034 #if SVC_EXTENSION 3035 #if VIEW_SCALABILITY 3036 if( m_scalabilityMask[VIEW_ORDER_INDEX] ) 3037 { 3038 3039 std::vector<Int> uniqueViewOrderIndices; 3040 std::vector<Int> uniqueViewIds; 3041 for( Int layer_idx = 0; layer_idx < m_numLayers; layer_idx++ ) 3042 { 3043 Bool isIn = false; 3044 for( Int uni = 0; uni < uniqueViewOrderIndices.size(); uni++ ) 3045 { 3046 isIn = isIn || ( *(cfg_viewOrderIndex[ layer_idx ]) == uniqueViewOrderIndices[ uni ] ); 3047 } 3048 if ( !isIn ) 3049 { 3050 uniqueViewOrderIndices.push_back( *(cfg_viewOrderIndex[ layer_idx ]) ); 3051 } 3052 3053 isIn = false; 3054 for( Int uni = 0; uni < uniqueViewIds.size(); uni++ ) 3055 { 3056 isIn = isIn || ( *(cfg_viewId[ layer_idx ]) == uniqueViewIds[ uni ] ); 3057 } 3058 if( !isIn ) 3059 { 3060 uniqueViewIds.push_back( *(cfg_viewId[ layer_idx ]) ); 3061 } 3062 3063 assert(uniqueViewIds.size()==uniqueViewOrderIndices.size()); 3064 3065 m_iNumberOfViews=uniqueViewIds.size(); 3066 3067 } 3068 3069 m_ViewIdVal = uniqueViewIds; 3070 m_iNumberOfViews = (Int)uniqueViewOrderIndices.size(); 3071 } 3072 #endif 3073 3023 3074 for( UInt layerIdx = 0; layerIdx < m_numLayers; layerIdx++ ) 3024 3075 { … … 4078 4129 } 4079 4130 #endif 4131 #if VIEW_SCALABILITY 4132 if (m_scalabilityMask[VIEW_ORDER_INDEX]) 4133 { 4134 xConfirmPara(m_apcLayerCfg[layerIdx]->m_viewId < 0 , "ViewId must be greater than or equal to 0"); 4135 xConfirmPara(m_apcLayerCfg[layerIdx]->m_viewOrderIndex < 0 , "ViewOrderIndex must be greater than or equal to 0"); 4136 4137 if( layerIdx > 0 ) 4138 { 4139 xConfirmPara(m_apcLayerCfg[layerIdx]->m_viewOrderIndex < m_apcLayerCfg[layerIdx-1]->m_viewOrderIndex, "ViewOrderIndex shall be increasing"); 4140 } 4141 4142 } 4143 #endif 4080 4144 #if CGS_3D_ASYMLUT 4081 4145 xConfirmPara( m_nCGSFlag < 0 || m_nCGSFlag > 1 , "0<=CGS<=1" ); … … 4226 4290 4227 4291 #if SVC_EXTENSION 4292 #if VIEW_SCALABILITY 4293 if( m_scalabilityMask[VIEW_ORDER_INDEX] ) 4294 { 4295 printf("ViewOrderIndex : %d\n", m_apcLayerCfg[layer]->m_viewOrderIndex ); 4296 printf("ViewId : %d\n", m_apcLayerCfg[layer]->m_viewId ); 4297 } 4298 #endif 4228 4299 printf("PTL index : %d\n", m_apcLayerCfg[layerIdx]->m_layerPTLIdx ); 4229 4300 } -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
r1526 r1534 118 118 Int m_numLayers; ///< number of layers 119 119 Int m_scalabilityMask[MAX_VPS_NUM_SCALABILITY_TYPES]; ///< scalability_mask 120 #if VIEW_SCALABILITY 121 Int m_iNumberOfViews; ///< number of views 122 std::vector<Int> m_ViewIdVal; 123 #endif 120 124 Bool m_maxTidRefPresentFlag; 121 125 -
branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h
r1526 r1534 54 54 Int m_auxId; 55 55 #endif 56 #if VIEW_SCALABILITY 57 Int m_viewOrderIndex; 58 Int m_viewId; 59 #endif 56 60 57 61 Int m_extraRPSs; ///< extra RPSs added to handle CRA … … 173 177 Int* getPredLayerIds() const { return m_predLayerIds; } 174 178 Int getPredLayerIdx(Int i) const { return m_predLayerIds[i]; } 179 #if VIEW_SCALABILITY 180 Int getViewOrderIndex() { return m_viewOrderIndex; } 181 Int getViewId() { return m_viewId; } 182 #endif 175 183 176 184 Int getRepFormatIdx() const { return m_repFormatIdx; } -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r1526 r1534 468 468 m_cTEncTop.setBottomRightTileIndex ( m_bottomRightTileIndex ); 469 469 m_cTEncTop.setIlcIdc ( m_ilcIdc ); 470 #endif 471 #if VIEW_SCALABILITY 472 m_cTEncTop.setUseDisparitySearchRangeRestriction ( m_scalabilityMask[VIEW_ORDER_INDEX] ); 470 473 #endif 471 474 … … 971 974 972 975 UInt i = 0, dimIdLen = 0; 976 #if VIEW_SCALABILITY 977 Int curDimId=0; 978 979 if( m_scalabilityMask[VIEW_ORDER_INDEX] ) 980 { 981 UInt maxViewOrderIndex = 0,maxViewId=0; 982 UInt voiLen = 1,vidLen=1; 983 984 for( i = 0; i < vps->getMaxLayers(); i++ ) 985 { 986 if( m_apcLayerCfg[i]->getViewOrderIndex() > maxViewOrderIndex ) 987 { 988 maxViewOrderIndex = m_apcLayerCfg[i]->getViewOrderIndex(); 989 } 990 991 if( m_apcLayerCfg[i]->getViewId() > maxViewId ) 992 { 993 maxViewId = m_apcLayerCfg[i]->getViewId(); 994 } 995 996 } 997 while((1 << voiLen) < (maxViewOrderIndex + 1)) 998 { 999 voiLen++; 1000 } 1001 1002 while((1 << vidLen) < (maxViewId + 1)) 1003 { 1004 vidLen++; 1005 } 1006 1007 vps->setDimensionIdLen(0, voiLen); 1008 vps->setViewIdLen(vidLen); 1009 1010 for( i = 0; i < vps->getMaxLayers(); i++ ) 1011 { 1012 vps->setDimensionId(i, 0, m_apcLayerCfg[i]->getViewOrderIndex()); 1013 } 1014 1015 for( i = 0; i < m_iNumberOfViews; i++ ) 1016 { 1017 vps->setViewIdVal(i, m_ViewIdVal[i]); 1018 } 1019 1020 curDimId++; 1021 } 1022 #endif 973 1023 974 1024 while((1 << dimIdLen) < m_numLayers) … … 976 1026 dimIdLen++; 977 1027 } 1028 #if VIEW_SCALABILITY 1029 vps->setDimensionIdLen(curDimId, dimIdLen); 1030 #else 978 1031 vps->setDimensionIdLen(0, dimIdLen); 1032 #endif 979 1033 vps->setNuhLayerIdPresentFlag(false); 980 1034 vps->setLayerIdInNuh(0, 0); … … 984 1038 vps->setLayerIdInNuh(i, m_apcLayerCfg[i]->m_layerId); 985 1039 vps->setLayerIdxInVps(vps->getLayerIdInNuh(i), i); 1040 #if VIEW_SCALABILITY 1041 vps->setDimensionId(i, curDimId, i); 1042 #else 986 1043 vps->setDimensionId(i, 0, i); 987 1044 #endif 988 1045 if( m_apcLayerCfg[i]->m_layerId != i ) 989 1046 { … … 1093 1150 scalabilityTypes += m_scalabilityMask[i]; 1094 1151 } 1152 #if VIEW_SCALABILITY 1153 assert( scalabilityTypes <= 3 ); 1154 #else 1095 1155 #if AUXILIARY_PICTURES 1096 1156 assert( scalabilityTypes <= 2 ); 1097 1157 #else 1098 1158 assert( scalabilityTypes == 1 ); 1159 #endif 1099 1160 #endif 1100 1161 vps->setNumScalabilityTypes(scalabilityTypes);
Note: See TracChangeset for help on using the changeset viewer.