Changeset 269 in SHVCSoftware
- Timestamp:
- 6 Jun 2013, 05:02:01 (12 years ago)
- Location:
- branches/SHM-2.1-multilayers-dev/source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/SHM-2.1-multilayers-dev/source/App/TAppEncoder/TAppEncCfg.cpp ¶
r245 r269 153 153 } 154 154 } 155 156 for(Int layer = 0; layer < MAX_LAYERS; layer++) 157 { 158 if( m_acLayerCfg[layer].m_numActiveRefLayers > 0 ) 159 { 160 delete [] m_acLayerCfg[layer].m_predLayerIds; 161 } 162 } 155 163 #endif 156 164 } … … 329 337 #if VPS_EXTN_DIRECT_REF_LAYERS 330 338 Int* cfg_numDirectRefLayers [MAX_LAYERS]; 331 string cfg_refLayerIds [MAX_LAYERS]; 332 string* cfg_refLayerIdsPtr [MAX_LAYERS]; 339 string cfg_refLayerIds [MAX_LAYERS]; 340 string* cfg_refLayerIdsPtr [MAX_LAYERS]; 341 342 Int* cfg_numActiveRefLayers [MAX_LAYERS]; 343 string cfg_predLayerIds [MAX_LAYERS]; 344 string* cfg_predLayerIdsPtr [MAX_LAYERS]; 333 345 #endif 334 346 #if SCALED_REF_LAYER_OFFSETS … … 360 372 cfg_numDirectRefLayers [layer] = &m_acLayerCfg[layer].m_numDirectRefLayers; 361 373 cfg_refLayerIdsPtr [layer] = &cfg_refLayerIds[layer]; 374 cfg_numActiveRefLayers [layer] = &m_acLayerCfg[layer].m_numActiveRefLayers; 375 cfg_predLayerIdsPtr [layer] = &cfg_predLayerIds[layer]; 362 376 #endif 363 377 #if SCALED_REF_LAYER_OFFSETS … … 422 436 ("NumDirectRefLayers%d", cfg_numDirectRefLayers, -1, MAX_LAYERS, "Number of direct reference layers") 423 437 ("RefLayerIds%d", cfg_refLayerIdsPtr, string(""), MAX_LAYERS, "direct reference layer IDs") 438 ("NumActiveRefLayers%d", cfg_numActiveRefLayers, -1, MAX_LAYERS, "Number of active reference layers") 439 ("PredLayerIds%d", cfg_predLayerIdsPtr, string(""), MAX_LAYERS, "inter-layer prediction layer IDs") 424 440 #endif 425 441 ("NumLayers", m_numLayers, 1, "Number of layers to code") … … 890 906 if( i >= m_acLayerCfg[layer].m_numDirectRefLayers ) 891 907 { 892 printf( " The number of columns whose width are defined is larger than the allowed number of columns.\n" );908 printf( "NumDirectRefLayers: The number of columns whose width are defined is larger than the allowed number of columns.\n" ); 893 909 exit( EXIT_FAILURE ); 894 910 } … … 899 915 if( i < m_acLayerCfg[layer].m_numDirectRefLayers ) 900 916 { 901 printf( " The width of some columns is not defined.\n" );917 printf( "NumDirectRefLayers: The width of some columns is not defined.\n" ); 902 918 exit( EXIT_FAILURE ); 903 919 } … … 906 922 { 907 923 m_acLayerCfg[layer].m_refLayerIds = NULL; 924 } 925 } 926 927 for(Int layer = 0; layer < MAX_LAYERS; layer++) 928 { 929 Char* pPredLayerIds = cfg_predLayerIds[layer].empty() ? NULL: strdup(cfg_predLayerIds[layer].c_str()); 930 if( m_acLayerCfg[layer].m_numActiveRefLayers > 0 ) 931 { 932 char *refLayerId; 933 int i=0; 934 m_acLayerCfg[layer].m_predLayerIds = new Int[m_acLayerCfg[layer].m_numActiveRefLayers]; 935 refLayerId = strtok(pPredLayerIds, " ,-"); 936 while(refLayerId != NULL) 937 { 938 if( i >= m_acLayerCfg[layer].m_numActiveRefLayers ) 939 { 940 printf( "NumActiveRefLayers: The number of columns whose width are defined is larger than the allowed number of columns.\n" ); 941 exit( EXIT_FAILURE ); 942 } 943 *( m_acLayerCfg[layer].m_predLayerIds + i ) = atoi( refLayerId ); 944 refLayerId = strtok(NULL, " ,-"); 945 i++; 946 } 947 if( i < m_acLayerCfg[layer].m_numActiveRefLayers ) 948 { 949 printf( "NumActiveRefLayers: The width of some columns is not defined.\n" ); 950 exit( EXIT_FAILURE ); 951 } 952 } 953 else 954 { 955 m_acLayerCfg[layer].m_predLayerIds = NULL; 908 956 } 909 957 } … … 1840 1888 } 1841 1889 } 1890 1891 xConfirmPara( (m_acLayerCfg[0].m_numActiveRefLayers != 0) && (m_acLayerCfg[0].m_numActiveRefLayers != -1), "Layer 0 cannot have any active reference layers" ); 1892 // 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 1893 for(Int layer = 1; layer < MAX_LAYERS; layer++) 1894 { 1895 xConfirmPara(m_acLayerCfg[layer].m_numActiveRefLayers > m_acLayerCfg[layer].m_numDirectRefLayers, "Cannot reference more layers than NumDirectRefLayers"); 1896 for(Int i = 0; i < m_acLayerCfg[layer].m_numActiveRefLayers; i++) 1897 { 1898 xConfirmPara(m_acLayerCfg[layer].m_predLayerIds[i] > m_acLayerCfg[layer].m_numDirectRefLayers, "Cannot reference higher layers"); 1899 } 1900 } 1842 1901 #endif 1843 1902 #undef xConfirmPara -
TabularUnified branches/SHM-2.1-multilayers-dev/source/App/TAppEncoder/TAppEncLayerCfg.h ¶
r211 r269 45 45 Int *m_refLayerIds; 46 46 Int m_numDirectRefLayers; 47 Int *m_predLayerIds; 48 Int m_numActiveRefLayers; 47 49 #endif 48 50 … … 108 110 Int* getRefLayerIds() {return m_refLayerIds; } 109 111 Int getRefLayerId(Int i) {return m_refLayerIds[i]; } 112 113 Int getNumActiveRefLayers() {return m_numActiveRefLayers;} 114 Int* getPredLayerIds() {return m_predLayerIds; } 115 Int getPredLayerId(Int i) {return m_predLayerIds[i]; } 110 116 #endif 111 117 #if RC_SHVC_HARMONIZATION -
TabularUnified branches/SHM-2.1-multilayers-dev/source/App/TAppEncoder/TAppEncTop.cpp ¶
r265 r269 159 159 { 160 160 m_acTEncTop[layer].setRefLayerId ( i, m_acLayerCfg[layer].getRefLayerId(i)); 161 } 161 } 162 } 163 164 if(m_acLayerCfg[layer].getNumActiveRefLayers() == -1) 165 { 166 m_acTEncTop[layer].setNumActiveRefLayers( m_acLayerCfg[layer].getNumDirectRefLayers() ); 167 for( Int i = 0; i < m_acTEncTop[layer].getNumActiveRefLayers(); i++ ) 168 { 169 m_acTEncTop[layer].setPredLayerId(i, i); 170 } 171 } 172 else 173 { 174 m_acTEncTop[layer].setNumActiveRefLayers ( m_acLayerCfg[layer].getNumActiveRefLayers() ); 175 for(Int i = 0; i < m_acTEncTop[layer].getNumActiveRefLayers(); i++) 176 { 177 m_acTEncTop[layer].setPredLayerId ( i, m_acLayerCfg[layer].getPredLayerId(i)); 178 } 162 179 } 163 180 } -
TabularUnified branches/SHM-2.1-multilayers-dev/source/Lib/TLibCommon/TypeDef.h ¶
r242 r269 47 47 #define SCALED_REF_LAYER_OFFSET_FLAG 1 ///< M0309: Signal scaled reference layer offsets in SPS 48 48 #define SCALED_REF_LAYER_OFFSETS 1 ///< M0309: Signal scaled reference layer offsets in SPS 49 #define MAX_LAYERS 2///< max number of layers the codec is supposed to handle49 #define MAX_LAYERS 3 ///< max number of layers the codec is supposed to handle 50 50 51 51 #define VPS_RENAME 1 ///< Rename variables max_layer_id and num_layer_sets_minus1 in VPS -
TabularUnified branches/SHM-2.1-multilayers-dev/source/Lib/TLibEncoder/TEncCfg.h ¶
r212 r269 145 145 Int m_numDirectRefLayers; 146 146 Int m_refLayerId[MAX_VPS_LAYER_ID_PLUS1]; 147 148 Int m_numActiveRefLayers; 149 Int m_predLayerId[MAX_VPS_LAYER_ID_PLUS1]; 147 150 #endif 148 151 //======= Transform ============= … … 405 408 Int getRefLayerId (Int i) { return m_refLayerId[i]; } 406 409 Void setRefLayerId (Int i, Int refLayerId) { m_refLayerId[i] = refLayerId; } 410 411 Int getNumActiveRefLayers () { return m_numActiveRefLayers; } 412 Void setNumActiveRefLayers (Int num) { m_numActiveRefLayers = num; } 413 414 Int getPredLayerId (Int i) { return m_predLayerId[i]; } 415 Void setPredLayerId (Int i, Int refLayerId) { m_predLayerId[i] = refLayerId; } 407 416 #endif 408 417 //======== Transform ============= -
TabularUnified branches/SHM-2.1-multilayers-dev/source/Lib/TLibEncoder/TEncSlice.cpp ¶
r260 r269 493 493 if( rpcSlice->getNumILRRefIdx() > 0 ) 494 494 { 495 rpcSlice->setActiveNumILRRefIdx( rpcSlice->getNumILRRefIdx() );495 rpcSlice->setActiveNumILRRefIdx( m_ppcTEncTop[layerId]->getNumActiveRefLayers() ); 496 496 for( Int i = 0; i < rpcSlice->getActiveNumILRRefIdx(); i++ ) 497 497 { 498 rpcSlice->setInterLayerPredLayerIdc( i, i);498 rpcSlice->setInterLayerPredLayerIdc( m_ppcTEncTop[layerId]->getPredLayerId(i), i ); 499 499 } 500 500 rpcSlice->setInterLayerPredEnabledFlag(1);
Note: See TracChangeset for help on using the changeset viewer.