Changeset 290 in SHVCSoftware for branches/SHM-2.1-dev/source
- Timestamp:
- 18 Jun 2013, 13:57:03 (12 years ago)
- Location:
- branches/SHM-2.1-dev/source
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r288 r290 146 146 { 147 147 #if VPS_EXTN_DIRECT_REF_LAYERS 148 #if M0457_PREDICTION_INDICATIONS 148 149 for(Int layer = 0; layer < MAX_LAYERS; layer++) 149 150 { 151 if( m_acLayerCfg[layer].m_numSamplePredRefLayers > 0 ) 152 { 153 delete [] m_acLayerCfg[layer].m_samplePredRefLayerIds; 154 } 155 } 156 for(Int layer = 0; layer < MAX_LAYERS; layer++) 157 { 158 if( m_acLayerCfg[layer].m_numMotionPredRefLayers > 0 ) 159 { 160 delete [] m_acLayerCfg[layer].m_motionPredRefLayerIds; 161 } 162 } 163 #else 164 for(Int layer = 0; layer < MAX_LAYERS; layer++) 165 { 150 166 if( m_acLayerCfg[layer].m_numDirectRefLayers > 0 ) 151 167 { … … 153 169 } 154 170 } 155 171 #endif 156 172 for(Int layer = 0; layer < MAX_LAYERS; layer++) 157 173 { … … 336 352 Int* cfg_conformanceMode [MAX_LAYERS]; 337 353 #if VPS_EXTN_DIRECT_REF_LAYERS 354 #if M0457_PREDICTION_INDICATIONS 355 Int* cfg_numSamplePredRefLayers [MAX_LAYERS]; 356 string cfg_samplePredRefLayerIds [MAX_LAYERS]; 357 string* cfg_samplePredRefLayerIdsPtr[MAX_LAYERS]; 358 Int* cfg_numMotionPredRefLayers [MAX_LAYERS]; 359 string cfg_motionPredRefLayerIds [MAX_LAYERS]; 360 string* cfg_motionPredRefLayerIdsPtr[MAX_LAYERS]; 361 #else 338 362 Int* cfg_numDirectRefLayers [MAX_LAYERS]; 339 363 string cfg_refLayerIds [MAX_LAYERS]; 340 364 string* cfg_refLayerIdsPtr [MAX_LAYERS]; 341 365 #endif 342 366 Int* cfg_numActiveRefLayers [MAX_LAYERS]; 343 367 string cfg_predLayerIds [MAX_LAYERS]; … … 376 400 cfg_conformanceMode[layer] = &m_acLayerCfg[layer].m_conformanceMode; 377 401 #if VPS_EXTN_DIRECT_REF_LAYERS 402 #if M0457_PREDICTION_INDICATIONS 403 cfg_numSamplePredRefLayers [layer] = &m_acLayerCfg[layer].m_numSamplePredRefLayers; 404 cfg_samplePredRefLayerIdsPtr[layer] = &cfg_samplePredRefLayerIds[layer]; 405 cfg_numMotionPredRefLayers [layer] = &m_acLayerCfg[layer].m_numMotionPredRefLayers; 406 cfg_motionPredRefLayerIdsPtr[layer] = &cfg_motionPredRefLayerIds[layer]; 407 #else 378 408 cfg_numDirectRefLayers [layer] = &m_acLayerCfg[layer].m_numDirectRefLayers; 379 409 cfg_refLayerIdsPtr [layer] = &cfg_refLayerIds[layer]; 410 #endif 380 411 cfg_numActiveRefLayers [layer] = &m_acLayerCfg[layer].m_numActiveRefLayers; 381 412 cfg_predLayerIdsPtr [layer] = &cfg_predLayerIds[layer]; … … 444 475 ("LambdaModifier%d,-LM%d", m_adLambdaModifier, ( double )1.0, MAX_TLAYER, "Lambda modifier for temporal layer %d") 445 476 #if VPS_EXTN_DIRECT_REF_LAYERS 477 #if M0457_PREDICTION_INDICATIONS 478 ("NumSamplePredRefLayers%d",cfg_numSamplePredRefLayers, -1, MAX_LAYERS, "Number of sample prediction reference layers") 479 ("SamplePredRefLayerIds%d", cfg_samplePredRefLayerIdsPtr, string(""), MAX_LAYERS, "sample pred reference layer IDs") 480 ("NumMotionPredRefLayers%d",cfg_numMotionPredRefLayers, -1, MAX_LAYERS, "Number of motion prediction reference layers") 481 ("MotionPredRefLayerIds%d", cfg_motionPredRefLayerIdsPtr, string(""), MAX_LAYERS, "motion pred reference layer IDs") 482 #else 446 483 ("NumDirectRefLayers%d", cfg_numDirectRefLayers, -1, MAX_LAYERS, "Number of direct reference layers") 447 484 ("RefLayerIds%d", cfg_refLayerIdsPtr, string(""), MAX_LAYERS, "direct reference layer IDs") 485 #endif 448 486 ("NumActiveRefLayers%d", cfg_numActiveRefLayers, -1, MAX_LAYERS, "Number of active reference layers") 449 487 ("PredLayerIds%d", cfg_predLayerIdsPtr, string(""), MAX_LAYERS, "inter-layer prediction layer IDs") … … 975 1013 #endif 976 1014 #if VPS_EXTN_DIRECT_REF_LAYERS 1015 #if M0457_PREDICTION_INDICATIONS 1016 for(Int layer = 0; layer < MAX_LAYERS; layer++) 1017 { 1018 Char* pSamplePredRefLayerIds = cfg_samplePredRefLayerIds[layer].empty() ? NULL: strdup(cfg_samplePredRefLayerIds[layer].c_str()); 1019 if( m_acLayerCfg[layer].m_numSamplePredRefLayers > 0 ) 1020 { 1021 char *samplePredRefLayerId; 1022 int i=0; 1023 m_acLayerCfg[layer].m_samplePredRefLayerIds = new Int[m_acLayerCfg[layer].m_numSamplePredRefLayers]; 1024 samplePredRefLayerId = strtok(pSamplePredRefLayerIds, " ,-"); 1025 while(samplePredRefLayerId != NULL) 1026 { 1027 if( i >= m_acLayerCfg[layer].m_numSamplePredRefLayers ) 1028 { 1029 printf( "NumSamplePredRefLayers: The number of columns whose width are defined is larger than the allowed number of columns.\n" ); 1030 exit( EXIT_FAILURE ); 1031 } 1032 *( m_acLayerCfg[layer].m_samplePredRefLayerIds + i ) = atoi( samplePredRefLayerId ); 1033 samplePredRefLayerId = strtok(NULL, " ,-"); 1034 i++; 1035 } 1036 if( i < m_acLayerCfg[layer].m_numSamplePredRefLayers ) 1037 { 1038 printf( "NumSamplePredRefLayers: The width of some columns is not defined.\n" ); 1039 exit( EXIT_FAILURE ); 1040 } 1041 } 1042 else 1043 { 1044 m_acLayerCfg[layer].m_samplePredRefLayerIds = NULL; 1045 } 1046 } 1047 for(Int layer = 0; layer < MAX_LAYERS; layer++) 1048 { 1049 Char* pMotionPredRefLayerIds = cfg_motionPredRefLayerIds[layer].empty() ? NULL: strdup(cfg_motionPredRefLayerIds[layer].c_str()); 1050 if( m_acLayerCfg[layer].m_numMotionPredRefLayers > 0 ) 1051 { 1052 char *motionPredRefLayerId; 1053 int i=0; 1054 m_acLayerCfg[layer].m_motionPredRefLayerIds = new Int[m_acLayerCfg[layer].m_numMotionPredRefLayers]; 1055 motionPredRefLayerId = strtok(pMotionPredRefLayerIds, " ,-"); 1056 while(motionPredRefLayerId != NULL) 1057 { 1058 if( i >= m_acLayerCfg[layer].m_numMotionPredRefLayers ) 1059 { 1060 printf( "NumMotionPredRefLayers: The number of columns whose width are defined is larger than the allowed number of columns.\n" ); 1061 exit( EXIT_FAILURE ); 1062 } 1063 *( m_acLayerCfg[layer].m_motionPredRefLayerIds + i ) = atoi( motionPredRefLayerId ); 1064 motionPredRefLayerId = strtok(NULL, " ,-"); 1065 i++; 1066 } 1067 if( i < m_acLayerCfg[layer].m_numMotionPredRefLayers ) 1068 { 1069 printf( "NumMotionPredRefLayers: The width of some columns is not defined.\n" ); 1070 exit( EXIT_FAILURE ); 1071 } 1072 } 1073 else 1074 { 1075 m_acLayerCfg[layer].m_motionPredRefLayerIds = NULL; 1076 } 1077 } 1078 #else 977 1079 for(Int layer = 0; layer < MAX_LAYERS; layer++) 978 1080 { … … 1006 1108 } 1007 1109 } 1008 1110 #endif 1009 1111 for(Int layer = 0; layer < MAX_LAYERS; layer++) 1010 1112 { … … 1959 2061 #endif 1960 2062 #if VPS_EXTN_DIRECT_REF_LAYERS 2063 #if M0457_PREDICTION_INDICATIONS 2064 xConfirmPara( (m_acLayerCfg[0].m_numSamplePredRefLayers != 0) && (m_acLayerCfg[0].m_numSamplePredRefLayers != -1), "Layer 0 cannot have any reference layers" ); 2065 // 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 2066 for(Int layer = 1; layer < MAX_LAYERS; layer++) 2067 { 2068 xConfirmPara(m_acLayerCfg[layer].m_numSamplePredRefLayers > layer, "Cannot reference more layers than before current layer"); 2069 for(Int i = 0; i < m_acLayerCfg[layer].m_numSamplePredRefLayers; i++) 2070 { 2071 xConfirmPara(m_acLayerCfg[layer].m_samplePredRefLayerIds[i] > layer, "Cannot reference higher layers"); 2072 xConfirmPara(m_acLayerCfg[layer].m_samplePredRefLayerIds[i] == layer, "Cannot reference the current layer itself"); 2073 } 2074 } 2075 xConfirmPara( (m_acLayerCfg[0].m_numMotionPredRefLayers != 0) && (m_acLayerCfg[0].m_numMotionPredRefLayers != -1), "Layer 0 cannot have any reference layers" ); 2076 // NOTE: m_numMotionPredRefLayers (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference 2077 for(Int layer = 1; layer < MAX_LAYERS; layer++) 2078 { 2079 xConfirmPara(m_acLayerCfg[layer].m_numMotionPredRefLayers > layer, "Cannot reference more layers than before current layer"); 2080 for(Int i = 0; i < m_acLayerCfg[layer].m_numMotionPredRefLayers; i++) 2081 { 2082 xConfirmPara(m_acLayerCfg[layer].m_motionPredRefLayerIds[i] > layer, "Cannot reference higher layers"); 2083 xConfirmPara(m_acLayerCfg[layer].m_motionPredRefLayerIds[i] == layer, "Cannot reference the current layer itself"); 2084 } 2085 } 2086 #else 1961 2087 xConfirmPara( (m_acLayerCfg[0].m_numDirectRefLayers != 0) && (m_acLayerCfg[0].m_numDirectRefLayers != -1), "Layer 0 cannot have any reference layers" ); 1962 2088 // 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 … … 1970 2096 } 1971 2097 } 1972 2098 #endif 1973 2099 xConfirmPara( (m_acLayerCfg[0].m_numActiveRefLayers != 0) && (m_acLayerCfg[0].m_numActiveRefLayers != -1), "Layer 0 cannot have any active reference layers" ); 1974 2100 // 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 1975 2101 for(Int layer = 1; layer < MAX_LAYERS; layer++) 1976 2102 { 2103 #if M0457_PREDICTION_INDICATIONS 2104 Bool predEnabledFlag[MAX_LAYERS]; 2105 for (Int refLayer = 0; refLayer < layer; refLayer++) 2106 { 2107 predEnabledFlag[refLayer] = false; 2108 } 2109 for(Int i = 0; i < m_acLayerCfg[layer].m_numSamplePredRefLayers; i++) 2110 { 2111 predEnabledFlag[m_acLayerCfg[layer].m_samplePredRefLayerIds[i]] = true; 2112 } 2113 for(Int i = 0; i < m_acLayerCfg[layer].m_numMotionPredRefLayers; i++) 2114 { 2115 predEnabledFlag[m_acLayerCfg[layer].m_motionPredRefLayerIds[i]] = true; 2116 } 2117 Int numDirectRefLayers = 0; 2118 for (Int refLayer = 0; refLayer < layer; refLayer++) 2119 { 2120 if (predEnabledFlag[refLayer] == true) numDirectRefLayers++; 2121 } 2122 xConfirmPara(m_acLayerCfg[layer].m_numActiveRefLayers > numDirectRefLayers, "Cannot reference more layers than NumDirectRefLayers"); 2123 for(Int i = 0; i < m_acLayerCfg[layer].m_numActiveRefLayers; i++) 2124 { 2125 xConfirmPara(m_acLayerCfg[layer].m_predLayerIds[i] > numDirectRefLayers, "Cannot reference higher layers"); 2126 } 2127 #else 1977 2128 xConfirmPara(m_acLayerCfg[layer].m_numActiveRefLayers > m_acLayerCfg[layer].m_numDirectRefLayers, "Cannot reference more layers than NumDirectRefLayers"); 1978 2129 for(Int i = 0; i < m_acLayerCfg[layer].m_numActiveRefLayers; i++) … … 1980 2131 xConfirmPara(m_acLayerCfg[layer].m_predLayerIds[i] > m_acLayerCfg[layer].m_numDirectRefLayers, "Cannot reference higher layers"); 1981 2132 } 2133 #endif 1982 2134 } 1983 2135 #endif -
branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncLayerCfg.h
r288 r290 43 43 Double m_fQP; ///< QP value of key-picture (floating point) 44 44 #if VPS_EXTN_DIRECT_REF_LAYERS 45 #if M0457_PREDICTION_INDICATIONS 46 Int *m_samplePredRefLayerIds; 47 Int m_numSamplePredRefLayers; 48 Int *m_motionPredRefLayerIds; 49 Int m_numMotionPredRefLayers; 50 #else 45 51 Int *m_refLayerIds; 46 52 Int m_numDirectRefLayers; 53 #endif 47 54 Int *m_predLayerIds; 48 55 Int m_numActiveRefLayers; … … 108 115 Int* getdQPs() {return m_aidQP; } 109 116 #if VPS_EXTN_DIRECT_REF_LAYERS 117 #if M0457_PREDICTION_INDICATIONS 118 Int getNumSamplePredRefLayers() {return m_numSamplePredRefLayers; } 119 Int* getSamplePredRefLayerIds() {return m_samplePredRefLayerIds; } 120 Int getSamplePredRefLayerId(Int i) {return m_samplePredRefLayerIds[i]; } 121 Int getNumMotionPredRefLayers() {return m_numMotionPredRefLayers; } 122 Int* getMotionPredRefLayerIds() {return m_motionPredRefLayerIds; } 123 Int getMotionPredRefLayerId(Int i) {return m_motionPredRefLayerIds[i]; } 124 #else 110 125 Int getNumDirectRefLayers() {return m_numDirectRefLayers;} 111 126 Int* getRefLayerIds() {return m_refLayerIds; } 112 127 Int getRefLayerId(Int i) {return m_refLayerIds[i]; } 128 #endif 113 129 114 130 Int getNumActiveRefLayers() {return m_numActiveRefLayers;} -
branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncTop.cpp
r288 r290 147 147 if(layer) 148 148 { 149 #if M0457_PREDICTION_INDICATIONS 150 for(Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1; i++) 151 { 152 m_acTEncTop[layer].setSamplePredEnabledFlag(i, false); 153 m_acTEncTop[layer].setMotionPredEnabledFlag(i, false); 154 } 155 if(m_acLayerCfg[layer].getNumSamplePredRefLayers() == -1) 156 { 157 // Not included in the configuration file; assume that each layer depends on previous layer 158 m_acTEncTop[layer].setNumSamplePredRefLayers (1); // One sample pred ref. layer 159 m_acTEncTop[layer].setSamplePredRefLayerId (0, layer - 1); // Previous layer 160 m_acTEncTop[layer].setSamplePredEnabledFlag (layer - 1, true); 161 } 162 else 163 { 164 m_acTEncTop[layer].setNumSamplePredRefLayers ( m_acLayerCfg[layer].getNumSamplePredRefLayers() ); 165 for(Int i = 0; i < m_acTEncTop[layer].getNumSamplePredRefLayers(); i++) 166 { 167 m_acTEncTop[layer].setSamplePredRefLayerId ( i, m_acLayerCfg[layer].getSamplePredRefLayerId(i)); 168 m_acTEncTop[layer].setSamplePredEnabledFlag (m_acLayerCfg[layer].getSamplePredRefLayerId(i), true); 169 } 170 } 171 if(m_acLayerCfg[layer].getNumMotionPredRefLayers() == -1) 172 { 173 // Not included in the configuration file; assume that each layer depends on previous layer 174 m_acTEncTop[layer].setNumMotionPredRefLayers (1); // One motion pred ref. layer 175 m_acTEncTop[layer].setMotionPredRefLayerId (0, layer - 1); // Previous layer 176 m_acTEncTop[layer].setMotionPredEnabledFlag (layer - 1, true); 177 } 178 else 179 { 180 m_acTEncTop[layer].setNumMotionPredRefLayers ( m_acLayerCfg[layer].getNumMotionPredRefLayers() ); 181 for(Int i = 0; i < m_acTEncTop[layer].getNumMotionPredRefLayers(); i++) 182 { 183 m_acTEncTop[layer].setMotionPredRefLayerId ( i, m_acLayerCfg[layer].getMotionPredRefLayerId(i)); 184 m_acTEncTop[layer].setMotionPredEnabledFlag (m_acLayerCfg[layer].getSamplePredRefLayerId(i), true); 185 } 186 } 187 Int numDirectRefLayers = 0; 188 for (Int i = 0; i < layer; i++) 189 { 190 if (m_acTEncTop[layer].getSamplePredEnabledFlag(i) || m_acTEncTop[layer].getMotionPredEnabledFlag(i)) 191 { 192 m_acTEncTop[layer].setRefLayerId(numDirectRefLayers, i); 193 numDirectRefLayers++; 194 } 195 } 196 m_acTEncTop[layer].setNumDirectRefLayers(numDirectRefLayers); 197 #else 149 198 if(m_acLayerCfg[layer].getNumDirectRefLayers() == -1) 150 199 { … … 161 210 } 162 211 } 163 212 #endif 164 213 if(m_acLayerCfg[layer].getNumActiveRefLayers() == -1) 165 214 { 215 #if M0457_PREDICTION_INDICATIONS 216 m_acTEncTop[layer].setNumActiveRefLayers( m_acTEncTop[layer].getNumDirectRefLayers() ); 217 #else 166 218 m_acTEncTop[layer].setNumActiveRefLayers( m_acLayerCfg[layer].getNumDirectRefLayers() ); 219 #endif 167 220 for( Int i = 0; i < m_acTEncTop[layer].getNumActiveRefLayers(); i++ ) 168 221 { … … 951 1004 vps->setDirectDependencyFlag( layerCtr, vps->getLayerIdInVps(m_acTEncTop[layerCtr].getRefLayerId(i)), true); 952 1005 } 1006 #if M0457_PREDICTION_INDICATIONS 1007 vps->setDirectDepTypeLen(2); // sample and motion types are encoded 1008 for(Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++) 1009 { 1010 if (vps->getDirectDependencyFlag( layerCtr, refLayerCtr)) 1011 { 1012 assert(m_acTEncTop[layerCtr].getSamplePredEnabledFlag(refLayerCtr) || m_acTEncTop[layerCtr].getMotionPredEnabledFlag(refLayerCtr)); 1013 vps->setDirectDependencyType( layerCtr, refLayerCtr, ((m_acTEncTop[layerCtr].getSamplePredEnabledFlag(refLayerCtr) ? 1 : 0) | 1014 (m_acTEncTop[layerCtr].getMotionPredEnabledFlag(refLayerCtr) ? 2 : 0)) - 1); 1015 } 1016 else 1017 { 1018 vps->setDirectDependencyType( layerCtr, refLayerCtr, 0 ); 1019 } 1020 } 1021 #endif 953 1022 } 954 1023 #endif -
branches/SHM-2.1-dev/source/Lib/TLibCommon/TComSlice.cpp
r289 r290 1671 1671 ::memset(m_numDirectRefLayers, 0, sizeof(m_numDirectRefLayers )); 1672 1672 ::memset(m_refLayerId, 0, sizeof(m_refLayerId )); 1673 #if M0457_PREDICTION_INDICATIONS 1674 m_directDepTypeLen = 2; 1675 ::memset(m_directDependencyType, 0, sizeof(m_directDependencyType)); 1676 #endif 1673 1677 #endif 1674 1678 #if DERIVE_LAYER_ID_LIST_VARIABLES -
branches/SHM-2.1-dev/source/Lib/TLibCommon/TComSlice.h
r289 r290 549 549 UInt m_numDirectRefLayers[MAX_VPS_LAYER_ID_PLUS1]; 550 550 UInt m_refLayerId[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 551 #if M0457_PREDICTION_INDICATIONS 552 UInt m_directDepTypeLen; 553 UInt m_directDependencyType[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 554 #endif 551 555 #endif 552 556 #if VPS_PROFILE_OUTPUT_LAYERS … … 694 698 UInt getRefLayerId(Int layerId, Int refLayerIdx) { return m_refLayerId[layerId][refLayerIdx]; } 695 699 Void setRefLayerId(Int layerId, Int refLayerIdx, UInt refLayerId) { m_refLayerId[layerId][refLayerIdx] = refLayerId; } 700 701 #if M0457_PREDICTION_INDICATIONS 702 UInt getDirectDepTypeLen() { return m_directDepTypeLen; } 703 Void setDirectDepTypeLen(UInt x) { m_directDepTypeLen = x; } 704 705 UInt getDirectDependencyType(Int currLayerId, Int refLayerId) { return m_directDependencyType[currLayerId][refLayerId]; } 706 Void setDirectDependencyType(Int currLayerId, Int refLayerId, UInt x) { m_directDependencyType[currLayerId][refLayerId] = x; } 707 #endif 696 708 #endif 697 709 #if VPS_PROFILE_OUTPUT_LAYERS -
branches/SHM-2.1-dev/source/Lib/TLibCommon/TypeDef.h
r289 r290 61 61 #define SPS_SUB_LAYER_INFO 1 ///< M0268: Do not signal sps_max_sub_layers_minus1 and sps_temporal_id_nesting_flag for nuh_layer_id greater than 0 62 62 #define VPS_SPLIT_FLAG 1 ///< M0163: Do not signal dimension_id and the last dimension_id_len_minus1, when splitting_flag is equal to 1. 63 #define M0457_PREDICTION_INDICATIONS 1 63 64 #endif 64 65 -
branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r289 r290 1143 1143 #endif 1144 1144 #endif 1145 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS 1146 READ_UVLC( uiCode, "direct_dep_type_len_minus2"); vps->setDirectDepTypeLen(uiCode+2); 1147 for(i = 1; i < vps->getMaxLayers(); i++) 1148 { 1149 for(j = 0; j < i; j++) 1150 { 1151 if (vps->getDirectDependencyFlag(i, j)) 1152 { 1153 READ_CODE( vps->getDirectDepTypeLen(), uiCode, "direct_dependency_type[i][j]" ); vps->setDirectDependencyType(i, j, uiCode); 1154 } 1155 } 1156 } 1157 #endif 1145 1158 } 1146 1159 #endif -
branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecTop.cpp
r288 r290 538 538 m_apcSlicePilot->setTLayerInfo(nalu.m_temporalId); 539 539 540 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS 541 setRefLayerParams(m_apcSlicePilot->getVPS()); 542 #endif 540 543 #if SVC_EXTENSION 541 544 m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder[m_layerId]); … … 1316 1319 #endif 1317 1320 1321 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS 1322 1323 Void TDecTop::setRefLayerParams( TComVPS* vps ) 1324 { 1325 for(UInt layer = 0; layer < m_numLayer; layer++) 1326 { 1327 TDecTop *decTop = (TDecTop *)getLayerDec(layer); 1328 decTop->setNumSamplePredRefLayers(0); 1329 decTop->setNumMotionPredRefLayers(0); 1330 decTop->setNumDirectRefLayers(0); 1331 for(Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1; i++) 1332 { 1333 decTop->setSamplePredEnabledFlag(i, false); 1334 decTop->setMotionPredEnabledFlag(i, false); 1335 decTop->setSamplePredRefLayerId(i, 0); 1336 decTop->setMotionPredRefLayerId(i, 0); 1337 } 1338 for(Int j = 0; j < layer; j++) 1339 { 1340 if (vps->getDirectDependencyFlag(layer, j)) 1341 { 1342 decTop->setRefLayerId(decTop->getNumDirectRefLayers(), vps->getLayerIdInNuh(layer)); 1343 decTop->setNumDirectRefLayers(decTop->getNumDirectRefLayers() + 1); 1344 1345 Int samplePredEnabledFlag = (vps->getDirectDependencyType(layer, j) + 1) & 1; 1346 decTop->setSamplePredEnabledFlag(j, samplePredEnabledFlag == 1 ? true : false); 1347 decTop->setNumSamplePredRefLayers(decTop->getNumSamplePredRefLayers() + samplePredEnabledFlag); 1348 1349 Int motionPredEnabledFlag = ((vps->getDirectDependencyType(layer, j) + 1) & 2) >> 1; 1350 decTop->setMotionPredEnabledFlag(j, motionPredEnabledFlag == 1 ? true : false); 1351 decTop->setNumMotionPredRefLayers(decTop->getNumMotionPredRefLayers() + motionPredEnabledFlag); 1352 } 1353 } 1354 } 1355 for ( Int i = 1, mIdx = 0, sIdx = 0; i < m_numLayer; i++ ) 1356 { 1357 Int iNuhLId = vps->getLayerIdInNuh(i); 1358 TDecTop *decTop = (TDecTop *)getLayerDec(iNuhLId); 1359 for ( Int j = 0; j < i; j++ ) 1360 { 1361 if (decTop->getMotionPredEnabledFlag(j)) 1362 { 1363 decTop->setMotionPredRefLayerId(mIdx++, vps->getLayerIdInNuh(j)); 1364 } 1365 if (decTop->getSamplePredEnabledFlag(j)) 1366 { 1367 decTop->setSamplePredRefLayerId(sIdx++, vps->getLayerIdInNuh(j)); 1368 } 1369 } 1370 } 1371 } 1372 1373 #endif 1318 1374 //! \} -
branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecTop.h
r250 r290 120 120 Int m_iBLSourceHeight; 121 121 #endif 122 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS 123 Int m_numDirectRefLayers; 124 Int m_refLayerId[MAX_VPS_LAYER_ID_PLUS1]; 125 Int m_numSamplePredRefLayers; 126 Int m_samplePredRefLayerId[MAX_VPS_LAYER_ID_PLUS1]; 127 Int m_numMotionPredRefLayers; 128 Int m_motionPredRefLayerId[MAX_VPS_LAYER_ID_PLUS1]; 129 Bool m_samplePredEnabledFlag[MAX_VPS_LAYER_ID_PLUS1]; 130 Bool m_motionPredEnabledFlag[MAX_VPS_LAYER_ID_PLUS1]; 131 #endif 122 132 #endif 123 133 #if AVC_SYNTAX || SYNTAX_OUTPUT … … 158 168 #if VPS_EXTN_DIRECT_REF_LAYERS 159 169 TDecTop* getRefLayerDec(UInt refLayerIdc); 170 #if M0457_PREDICTION_INDICATIONS 171 Int getNumDirectRefLayers () { return m_numDirectRefLayers; } 172 Void setNumDirectRefLayers (Int num) { m_numDirectRefLayers = num; } 173 174 Int getRefLayerId (Int i) { return m_refLayerId[i]; } 175 Void setRefLayerId (Int i, Int refLayerId) { m_refLayerId[i] = refLayerId; } 176 177 Int getNumSamplePredRefLayers () { return m_numSamplePredRefLayers; } 178 Void setNumSamplePredRefLayers (Int num) { m_numSamplePredRefLayers = num; } 179 180 Int getSamplePredRefLayerId (Int i) { return m_samplePredRefLayerId[i]; } 181 Void setSamplePredRefLayerId (Int i, Int refLayerId) { m_samplePredRefLayerId[i] = refLayerId; } 182 183 Int getNumMotionPredRefLayers () { return m_numMotionPredRefLayers; } 184 Void setNumMotionPredRefLayers (Int num) { m_numMotionPredRefLayers = num; } 185 186 Int getMotionPredRefLayerId (Int i) { return m_motionPredRefLayerId[i]; } 187 Void setMotionPredRefLayerId (Int i, Int refLayerId) { m_motionPredRefLayerId[i] = refLayerId; } 188 189 Bool getSamplePredEnabledFlag (Int i) { return m_samplePredEnabledFlag[i]; } 190 Void setSamplePredEnabledFlag (Int i,Bool flag) { m_samplePredEnabledFlag[i] = flag; } 191 192 Bool getMotionPredEnabledFlag (Int i) { return m_motionPredEnabledFlag[i]; } 193 Void setMotionPredEnabledFlag (Int i,Bool flag) { m_motionPredEnabledFlag[i] = flag; } 194 195 TDecTop* getSamplePredRefLayerDec ( UInt layerId ); 196 TDecTop* getMotionPredRefLayerDec ( UInt layerId ); 197 198 Void setRefLayerParams( TComVPS* vps ); 199 #endif 160 200 #endif 161 201 #if AVC_BASE -
branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r289 r290 864 864 #endif 865 865 #endif 866 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS 867 WRITE_UVLC( vps->getDirectDepTypeLen()-2, "direct_dep_type_len_minus2"); 868 for(i = 1; i < vps->getMaxLayers(); i++) 869 { 870 for(j = 0; j < i; j++) 871 { 872 if (vps->getDirectDependencyFlag(i, j)) 873 { 874 WRITE_CODE( vps->getDirectDependencyType(i, j), vps->getDirectDepTypeLen(), "direct_dependency_type[i][j]" ); 875 } 876 } 877 } 878 #endif 866 879 } 867 880 #endif -
branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncCfg.h
r282 r290 148 148 Int m_numActiveRefLayers; 149 149 Int m_predLayerId[MAX_VPS_LAYER_ID_PLUS1]; 150 #if M0457_PREDICTION_INDICATIONS 151 Int m_numSamplePredRefLayers; 152 Int m_samplePredRefLayerId[MAX_VPS_LAYER_ID_PLUS1]; 153 Int m_numMotionPredRefLayers; 154 Int m_motionPredRefLayerId[MAX_VPS_LAYER_ID_PLUS1]; 155 Bool m_samplePredEnabledFlag[MAX_VPS_LAYER_ID_PLUS1]; 156 Bool m_motionPredEnabledFlag[MAX_VPS_LAYER_ID_PLUS1]; 157 #endif 150 158 #endif 151 159 //======= Transform ============= … … 414 422 Int getPredLayerId (Int i) { return m_predLayerId[i]; } 415 423 Void setPredLayerId (Int i, Int refLayerId) { m_predLayerId[i] = refLayerId; } 424 425 #if M0457_PREDICTION_INDICATIONS 426 Int getNumSamplePredRefLayers () { return m_numSamplePredRefLayers; } 427 Void setNumSamplePredRefLayers (Int num) { m_numSamplePredRefLayers = num; } 428 429 Int getSamplePredRefLayerId (Int i) { return m_samplePredRefLayerId[i]; } 430 Void setSamplePredRefLayerId (Int i, Int refLayerId) { m_samplePredRefLayerId[i] = refLayerId; } 431 432 Int getNumMotionPredRefLayers () { return m_numMotionPredRefLayers; } 433 Void setNumMotionPredRefLayers (Int num) { m_numMotionPredRefLayers = num; } 434 435 Int getMotionPredRefLayerId (Int i) { return m_motionPredRefLayerId[i]; } 436 Void setMotionPredRefLayerId (Int i, Int refLayerId) { m_motionPredRefLayerId[i] = refLayerId; } 437 438 Bool getSamplePredEnabledFlag (Int i) { return m_samplePredEnabledFlag[i]; } 439 Void setSamplePredEnabledFlag (Int i,Bool flag) { m_samplePredEnabledFlag[i] = flag; } 440 441 Bool getMotionPredEnabledFlag (Int i) { return m_motionPredEnabledFlag[i]; } 442 Void setMotionPredEnabledFlag (Int i,Bool flag) { m_motionPredEnabledFlag[i] = flag; } 443 #endif 416 444 #endif 417 445 //======== Transform =============
Note: See TracChangeset for help on using the changeset viewer.