Changeset 560 in SHVCSoftware for branches/SHM-5.0-dev/source
- Timestamp:
- 27 Jan 2014, 17:25:26 (11 years ago)
- Location:
- branches/SHM-5.0-dev/source
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-5.0-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r559 r560 143 143 { 144 144 #if VPS_EXTN_DIRECT_REF_LAYERS 145 #if M0457_PREDICTION_INDICATIONS146 145 for(Int layer = 0; layer < MAX_LAYERS; layer++) 147 146 { … … 149 148 { 150 149 delete [] m_acLayerCfg[layer].m_samplePredRefLayerIds; 151 } 152 } 153 for(Int layer = 0; layer < MAX_LAYERS; layer++) 154 { 150 m_acLayerCfg[layer].m_samplePredRefLayerIds = NULL; 151 } 155 152 if( m_acLayerCfg[layer].m_numMotionPredRefLayers > 0 ) 156 153 { 157 154 delete [] m_acLayerCfg[layer].m_motionPredRefLayerIds; 158 } 159 } 160 #else 161 for(Int layer = 0; layer < MAX_LAYERS; layer++) 162 { 163 if( m_acLayerCfg[layer].m_numDirectRefLayers > 0 ) 164 { 165 delete [] m_acLayerCfg[layer].m_refLayerIds; 166 } 167 } 168 #endif 169 for(Int layer = 0; layer < MAX_LAYERS; layer++) 170 { 155 m_acLayerCfg[layer].m_motionPredRefLayerIds = NULL; 156 } 171 157 if( m_acLayerCfg[layer].m_numActiveRefLayers > 0 ) 172 158 { 173 159 delete [] m_acLayerCfg[layer].m_predLayerIds; 160 m_acLayerCfg[layer].m_predLayerIds = NULL; 174 161 } 175 162 } … … 380 367 #endif 381 368 #if VPS_EXTN_DIRECT_REF_LAYERS 382 #if M0457_PREDICTION_INDICATIONS383 369 Int* cfg_numSamplePredRefLayers [MAX_LAYERS]; 384 370 string cfg_samplePredRefLayerIds [MAX_LAYERS]; … … 387 373 string cfg_motionPredRefLayerIds [MAX_LAYERS]; 388 374 string* cfg_motionPredRefLayerIdsPtr[MAX_LAYERS]; 389 #else390 Int* cfg_numDirectRefLayers [MAX_LAYERS];391 string cfg_refLayerIds [MAX_LAYERS];392 string* cfg_refLayerIdsPtr [MAX_LAYERS];393 #endif394 375 Int* cfg_numActiveRefLayers [MAX_LAYERS]; 395 376 string cfg_predLayerIds [MAX_LAYERS]; … … 459 440 #endif 460 441 #if VPS_EXTN_DIRECT_REF_LAYERS 461 #if M0457_PREDICTION_INDICATIONS462 442 cfg_numSamplePredRefLayers [layer] = &m_acLayerCfg[layer].m_numSamplePredRefLayers; 463 443 cfg_samplePredRefLayerIdsPtr[layer] = &cfg_samplePredRefLayerIds[layer]; 464 444 cfg_numMotionPredRefLayers [layer] = &m_acLayerCfg[layer].m_numMotionPredRefLayers; 465 445 cfg_motionPredRefLayerIdsPtr[layer] = &cfg_motionPredRefLayerIds[layer]; 466 #else467 cfg_numDirectRefLayers [layer] = &m_acLayerCfg[layer].m_numDirectRefLayers;468 cfg_refLayerIdsPtr [layer] = &cfg_refLayerIds[layer];469 #endif470 446 cfg_numActiveRefLayers [layer] = &m_acLayerCfg[layer].m_numActiveRefLayers; 471 447 cfg_predLayerIdsPtr [layer] = &cfg_predLayerIds[layer]; … … 548 524 #endif 549 525 #if VPS_EXTN_DIRECT_REF_LAYERS 550 #if M0457_PREDICTION_INDICATIONS551 526 ("NumSamplePredRefLayers%d",cfg_numSamplePredRefLayers, -1, MAX_LAYERS, "Number of sample prediction reference layers") 552 527 ("SamplePredRefLayerIds%d", cfg_samplePredRefLayerIdsPtr, string(""), MAX_LAYERS, "sample pred reference layer IDs") 553 528 ("NumMotionPredRefLayers%d",cfg_numMotionPredRefLayers, -1, MAX_LAYERS, "Number of motion prediction reference layers") 554 529 ("MotionPredRefLayerIds%d", cfg_motionPredRefLayerIdsPtr, string(""), MAX_LAYERS, "motion pred reference layer IDs") 555 #else556 ("NumDirectRefLayers%d", cfg_numDirectRefLayers, -1, MAX_LAYERS, "Number of direct reference layers")557 ("RefLayerIds%d", cfg_refLayerIdsPtr, string(""), MAX_LAYERS, "direct reference layer IDs")558 #endif559 530 ("NumActiveRefLayers%d", cfg_numActiveRefLayers, -1, MAX_LAYERS, "Number of active reference layers") 560 531 ("PredLayerIds%d", cfg_predLayerIdsPtr, string(""), MAX_LAYERS, "inter-layer prediction layer IDs") … … 1184 1155 } 1185 1156 #if VPS_EXTN_DIRECT_REF_LAYERS 1186 #if M0457_PREDICTION_INDICATIONS1187 1157 for(Int layer = 0; layer < MAX_LAYERS; layer++) 1188 1158 { … … 1247 1217 } 1248 1218 } 1249 #else 1250 for(Int layer = 0; layer < MAX_LAYERS; layer++) 1251 { 1252 Char* pRefLayerIds = cfg_refLayerIds[layer].empty() ? NULL: strdup(cfg_refLayerIds[layer].c_str()); 1253 if( m_acLayerCfg[layer].m_numDirectRefLayers > 0 ) 1254 { 1255 char *refLayerId; 1256 int i=0; 1257 m_acLayerCfg[layer].m_refLayerIds = new Int[m_acLayerCfg[layer].m_numDirectRefLayers]; 1258 refLayerId = strtok(pRefLayerIds, " ,-"); 1259 while(refLayerId != NULL) 1260 { 1261 if( i >= m_acLayerCfg[layer].m_numDirectRefLayers ) 1262 { 1263 printf( "NumDirectRefLayers: The number of columns whose width are defined is larger than the allowed number of columns.\n" ); 1264 exit( EXIT_FAILURE ); 1265 } 1266 *( m_acLayerCfg[layer].m_refLayerIds + i ) = atoi( refLayerId ); 1267 refLayerId = strtok(NULL, " ,-"); 1268 i++; 1269 } 1270 if( i < m_acLayerCfg[layer].m_numDirectRefLayers ) 1271 { 1272 printf( "NumDirectRefLayers: The width of some columns is not defined.\n" ); 1273 exit( EXIT_FAILURE ); 1274 } 1275 } 1276 else 1277 { 1278 m_acLayerCfg[layer].m_refLayerIds = NULL; 1279 } 1280 } 1281 #endif 1219 1282 1220 #if AUXILIARY_PICTURES 1283 1221 for(UInt layer = 0; layer < MAX_LAYERS; layer++) … … 2225 2163 } 2226 2164 #if VPS_EXTN_DIRECT_REF_LAYERS 2227 #if M0457_PREDICTION_INDICATIONS2228 2165 xConfirmPara( (m_acLayerCfg[0].m_numSamplePredRefLayers != 0) && (m_acLayerCfg[0].m_numSamplePredRefLayers != -1), "Layer 0 cannot have any reference layers" ); 2229 2166 // NOTE: m_numSamplePredRefLayers (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference … … 2248 2185 } 2249 2186 } 2250 #else 2251 xConfirmPara( (m_acLayerCfg[0].m_numDirectRefLayers != 0) && (m_acLayerCfg[0].m_numDirectRefLayers != -1), "Layer 0 cannot have any reference layers" ); 2252 // NOTE: m_numDirectRefLayers (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference 2253 for(Int layer = 1; layer < MAX_LAYERS; layer++) 2254 { 2255 xConfirmPara(m_acLayerCfg[layer].m_numDirectRefLayers > layer, "Cannot reference more layers than before current layer"); 2256 for(Int i = 0; i < m_acLayerCfg[layer].m_numDirectRefLayers; i++) 2257 { 2258 xConfirmPara(m_acLayerCfg[layer].m_refLayerIds[i] > layer, "Cannot reference higher layers"); 2259 xConfirmPara(m_acLayerCfg[layer].m_refLayerIds[i] == layer, "Cannot reference the current layer itself"); 2260 } 2261 } 2262 #endif 2187 2263 2188 xConfirmPara( (m_acLayerCfg[0].m_numActiveRefLayers != 0) && (m_acLayerCfg[0].m_numActiveRefLayers != -1), "Layer 0 cannot have any active reference layers" ); 2264 2189 // NOTE: m_numActiveRefLayers (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference 2265 2190 for(Int layer = 1; layer < MAX_LAYERS; layer++) 2266 2191 { 2267 #if M0457_PREDICTION_INDICATIONS2268 2192 Bool predEnabledFlag[MAX_LAYERS]; 2269 2193 for (Int refLayer = 0; refLayer < layer; refLayer++) … … 2289 2213 xConfirmPara(m_acLayerCfg[layer].m_predLayerIds[i] >= numDirectRefLayers, "Cannot reference higher layers"); 2290 2214 } 2291 #else 2292 xConfirmPara(m_acLayerCfg[layer].m_numActiveRefLayers > m_acLayerCfg[layer].m_numDirectRefLayers, "Cannot reference more layers than NumDirectRefLayers"); 2293 for(Int i = 0; i < m_acLayerCfg[layer].m_numActiveRefLayers; i++) 2294 { 2295 xConfirmPara(m_acLayerCfg[layer].m_predLayerIds[i] >= m_acLayerCfg[layer].m_numDirectRefLayers, "Cannot reference higher layers"); 2296 } 2297 #endif 2298 } 2299 #endif 2215 } 2216 #endif //VPS_EXTN_DIRECT_REF_LAYERS 2300 2217 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 2301 2218 if (m_adaptiveResolutionChange > 0) -
branches/SHM-5.0-dev/source/App/TAppEncoder/TAppEncLayerCfg.h
r540 r560 48 48 #endif 49 49 #if VPS_EXTN_DIRECT_REF_LAYERS 50 #if M0457_PREDICTION_INDICATIONS51 50 Int *m_samplePredRefLayerIds; 52 51 Int m_numSamplePredRefLayers; 53 52 Int *m_motionPredRefLayerIds; 54 53 Int m_numMotionPredRefLayers; 55 #else56 Int *m_refLayerIds;57 Int m_numDirectRefLayers;58 #endif59 54 Int *m_predLayerIds; 60 55 Int m_numActiveRefLayers; … … 153 148 Int* getdQPs() {return m_aidQP; } 154 149 #if VPS_EXTN_DIRECT_REF_LAYERS 155 #if M0457_PREDICTION_INDICATIONS156 150 Int getNumSamplePredRefLayers() {return m_numSamplePredRefLayers; } 157 151 Int* getSamplePredRefLayerIds() {return m_samplePredRefLayerIds; } … … 160 154 Int* getMotionPredRefLayerIds() {return m_motionPredRefLayerIds; } 161 155 Int getMotionPredRefLayerId(Int i) {return m_motionPredRefLayerIds[i]; } 162 #else163 Int getNumDirectRefLayers() {return m_numDirectRefLayers;}164 Int* getRefLayerIds() {return m_refLayerIds; }165 Int getRefLayerId(Int i) {return m_refLayerIds[i]; }166 #endif167 156 168 157 Int getNumActiveRefLayers() {return m_numActiveRefLayers;} -
branches/SHM-5.0-dev/source/App/TAppEncoder/TAppEncTop.cpp
r559 r560 209 209 #if REF_IDX_MFM 210 210 #if AVC_BASE 211 #if M0457_PREDICTION_INDICATIONS212 211 m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : ( m_avcBaseLayerFlag ? AVC_SYNTAX : true ) && m_acLayerCfg[layer].getNumMotionPredRefLayers()); 213 212 #else 214 m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : ( m_avcBaseLayerFlag ? AVC_SYNTAX : true ));215 #endif216 #else217 #if M0457_PREDICTION_INDICATIONS218 213 m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : ( m_acLayerCfg[layer].getNumMotionPredRefLayers() > 0 ) ); 219 #else220 m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : true);221 #endif222 214 #endif 223 215 #endif … … 258 250 if(layer) 259 251 { 260 #if M0457_PREDICTION_INDICATIONS261 252 for(Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1; i++) 262 253 { … … 306 297 } 307 298 m_acTEncTop[layer].setNumDirectRefLayers(numDirectRefLayers); 308 #else 309 if(m_acLayerCfg[layer].getNumDirectRefLayers() == -1) 310 { 311 // Not included in the configuration file; assume that each layer depends on previous layer 312 m_acTEncTop[layer].setNumDirectRefLayers (1); // One ref. layer 313 m_acTEncTop[layer].setRefLayerId (0, layer - 1); // Previous layer 314 } 315 else 316 { 317 m_acTEncTop[layer].setNumDirectRefLayers ( m_acLayerCfg[layer].getNumDirectRefLayers() ); 318 for(Int i = 0; i < m_acTEncTop[layer].getNumDirectRefLayers(); i++) 319 { 320 m_acTEncTop[layer].setRefLayerId ( i, m_acLayerCfg[layer].getRefLayerId(i)); 321 } 322 } 323 #endif 299 324 300 if(m_acLayerCfg[layer].getNumActiveRefLayers() == -1) 325 301 { 326 #if M0457_PREDICTION_INDICATIONS327 302 m_acTEncTop[layer].setNumActiveRefLayers( m_acTEncTop[layer].getNumDirectRefLayers() ); 328 #else329 m_acTEncTop[layer].setNumActiveRefLayers( m_acLayerCfg[layer].getNumDirectRefLayers() );330 #endif331 303 for( Int i = 0; i < m_acTEncTop[layer].getNumActiveRefLayers(); i++ ) 332 304 { … … 343 315 } 344 316 } 345 #endif 317 #endif //VPS_EXTN_DIRECT_REF_LAYERS 346 318 //===== Slice ======== 347 319 … … 1271 1243 vps->setDirectDependencyFlag( layerCtr, vps->getLayerIdInVps(m_acTEncTop[layerCtr].getRefLayerId(i)), true); 1272 1244 } 1273 #if M0457_PREDICTION_INDICATIONS 1245 #if SVC_EXTENSION 1246 // prediction indications 1274 1247 vps->setDirectDepTypeLen(2); // sample and motion types are encoded 1275 1248 for(Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++) -
branches/SHM-5.0-dev/source/Lib/TLibCommon/TComSlice.cpp
r559 r560 2076 2076 ::memset(m_numDirectRefLayers, 0, sizeof(m_numDirectRefLayers )); 2077 2077 ::memset(m_refLayerId, 0, sizeof(m_refLayerId )); 2078 #if M0457_PREDICTION_INDICATIONS2079 2078 m_directDepTypeLen = 2; 2080 2079 ::memset(m_directDependencyType, 0, sizeof(m_directDependencyType)); 2081 #endif2082 2080 #endif 2083 2081 #if DERIVE_LAYER_ID_LIST_VARIABLES -
branches/SHM-5.0-dev/source/Lib/TLibCommon/TComSlice.h
r559 r560 530 530 UInt m_numDirectRefLayers[MAX_VPS_LAYER_ID_PLUS1]; 531 531 UInt m_refLayerId[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 532 #if M0457_PREDICTION_INDICATIONS533 532 UInt m_directDepTypeLen; 534 533 #if O0096_DEFAULT_DEPENDENCY_TYPE … … 537 536 #endif 538 537 UInt m_directDependencyType[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 539 #endif540 538 #endif 541 539 UInt m_numProfileTierLevel; … … 814 812 Void setRefLayerId(Int layerId, Int refLayerIdx, UInt refLayerId) { m_refLayerId[layerId][refLayerIdx] = refLayerId; } 815 813 816 #if M0457_PREDICTION_INDICATIONS817 814 UInt getDirectDepTypeLen() { return m_directDepTypeLen; } 818 815 Void setDirectDepTypeLen(UInt x) { m_directDepTypeLen = x; } … … 825 822 UInt getDirectDependencyType(Int currLayerId, Int refLayerId) { return m_directDependencyType[currLayerId][refLayerId]; } 826 823 Void setDirectDependencyType(Int currLayerId, Int refLayerId, UInt x) { m_directDependencyType[currLayerId][refLayerId] = x; } 827 #endif828 824 #endif 829 825 UInt getNumProfileTierLevel() { return m_numProfileTierLevel; } -
branches/SHM-5.0-dev/source/Lib/TLibCommon/TypeDef.h
r559 r560 112 112 #define VPS_EXTN_PROFILE_INFO 1 ///< Include profile information for layer sets in VPS extension 113 113 #define VPS_EXTN_DIRECT_REF_LAYERS 1 ///< Include indication of direct dependency of layers in VPS extension 114 #define M0457_PREDICTION_INDICATIONS 1115 114 #define M0040_ADAPTIVE_RESOLUTION_CHANGE 1 116 115 #define VPS_VUI 1 ///< Include function structure for VPS VUI -
branches/SHM-5.0-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r559 r560 1428 1428 } 1429 1429 #endif 1430 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS1430 #if VPS_EXTN_DIRECT_REF_LAYERS 1431 1431 READ_UVLC( uiCode, "direct_dep_type_len_minus2"); vps->setDirectDepTypeLen(uiCode+2); 1432 1432 #if O0096_DEFAULT_DEPENDENCY_TYPE -
branches/SHM-5.0-dev/source/Lib/TLibDecoder/TDecTop.cpp
r559 r560 845 845 #if SVC_EXTENSION 846 846 m_apcSlicePilot->setSliceIdx( m_uiSliceIdx ); // it should be removed if HM will reflect it in above 847 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS847 #if VPS_EXTN_DIRECT_REF_LAYERS 848 848 setRefLayerParams(m_apcSlicePilot->getVPS()); 849 849 #endif … … 1963 1963 #endif 1964 1964 1965 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS1965 #if VPS_EXTN_DIRECT_REF_LAYERS 1966 1966 1967 1967 Void TDecTop::setRefLayerParams( TComVPS* vps ) -
branches/SHM-5.0-dev/source/Lib/TLibDecoder/TDecTop.h
r540 r560 117 117 Int m_iBLSourceHeight; 118 118 #endif 119 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS119 #if VPS_EXTN_DIRECT_REF_LAYERS 120 120 Int m_numDirectRefLayers; 121 121 Int m_refLayerId[MAX_VPS_LAYER_ID_PLUS1]; … … 177 177 #if VPS_EXTN_DIRECT_REF_LAYERS 178 178 TDecTop* getRefLayerDec(UInt refLayerIdc); 179 #if M0457_PREDICTION_INDICATIONS180 179 Int getNumDirectRefLayers () { return m_numDirectRefLayers; } 181 180 Void setNumDirectRefLayers (Int num) { m_numDirectRefLayers = num; } … … 206 205 207 206 Void setRefLayerParams( TComVPS* vps ); 208 #endif209 207 #endif 210 208 #if AVC_BASE -
branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r559 r560 1089 1089 } 1090 1090 #endif 1091 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS1091 #if VPS_EXTN_DIRECT_REF_LAYERS 1092 1092 WRITE_UVLC( vps->getDirectDepTypeLen()-2, "direct_dep_type_len_minus2"); 1093 1093 #if O0096_DEFAULT_DEPENDENCY_TYPE -
branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncCfg.h
r540 r560 168 168 Int m_numActiveRefLayers; 169 169 Int m_predLayerId[MAX_VPS_LAYER_ID_PLUS1]; 170 #if M0457_PREDICTION_INDICATIONS171 170 Int m_numSamplePredRefLayers; 172 171 Int m_samplePredRefLayerId[MAX_VPS_LAYER_ID_PLUS1]; … … 175 174 Bool m_samplePredEnabledFlag[MAX_VPS_LAYER_ID_PLUS1]; 176 175 Bool m_motionPredEnabledFlag[MAX_VPS_LAYER_ID_PLUS1]; 177 #endif178 176 #endif 179 177 #if N0120_MAX_TID_REF_CFG … … 452 450 Void setPredLayerId (Int i, Int refLayerId) { m_predLayerId[i] = refLayerId; } 453 451 454 #if M0457_PREDICTION_INDICATIONS455 452 Int getNumSamplePredRefLayers () { return m_numSamplePredRefLayers; } 456 453 Void setNumSamplePredRefLayers (Int num) { m_numSamplePredRefLayers = num; } … … 470 467 Bool getMotionPredEnabledFlag (Int i) { return m_motionPredEnabledFlag[i]; } 471 468 Void setMotionPredEnabledFlag (Int i,Bool flag) { m_motionPredEnabledFlag[i] = flag; } 472 #endif473 469 #endif 474 470 #if N0120_MAX_TID_REF_CFG
Note: See TracChangeset for help on using the changeset viewer.