Changeset 475 in SHVCSoftware for branches/SHM-4.0-dev/source/App
- Timestamp:
- 15 Nov 2013, 14:55:37 (11 years ago)
- Location:
- branches/SHM-4.0-dev/source/App/TAppEncoder
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r471 r475 224 224 } 225 225 226 #if AUXILIARY_PICTURES 227 static inline ChromaFormat numberToChromaFormat(const Int val) 228 { 229 switch (val) 230 { 231 case 400: return CHROMA_400; break; 232 case 420: return CHROMA_420; break; 233 case 422: return CHROMA_422; break; 234 case 444: return CHROMA_444; break; 235 default: return NUM_CHROMA_FORMAT; 236 } 237 } 238 #endif 239 226 240 #if SVC_EXTENSION 227 241 void TAppEncCfg::getDirFilename(string& filename, string& dir, const string path) … … 363 377 UInt* cfg_uiQuadtreeTUMaxDepthIntra[MAX_LAYERS]; 364 378 #endif 379 #if AUXILIARY_PICTURES 380 Int cfg_tmpChromaFormatIDC [MAX_LAYERS]; 381 Int cfg_tmpInputChromaFormat[MAX_LAYERS]; 382 Int* cfg_auxId [MAX_LAYERS]; 383 #endif 365 384 #if VPS_EXTN_DIRECT_REF_LAYERS 366 385 #if M0457_PREDICTION_INDICATIONS … … 477 496 cfg_maxTidIlRefPicsPlus1[layer] = &m_acLayerCfg[layer].m_maxTidIlRefPicsPlus1; 478 497 #endif 498 #if AUXILIARY_PICTURES 499 cfg_auxId[layer] = &m_acLayerCfg[layer].m_auxId; 500 #endif 479 501 } 480 502 #if AVC_BASE … … 533 555 #endif 534 556 ("NumLayers", m_numLayers, 1, "Number of layers to code") 557 #if AUXILIARY_PICTURES 558 ("InputChromaFormat%d", cfg_tmpInputChromaFormat, 420, MAX_LAYERS, "InputChromaFormatIDC for layer %d") 559 ("ChromaFormatIDC%d,-cf", cfg_tmpChromaFormatIDC, 420, MAX_LAYERS, "ChromaFormatIDC (400|420|422|444 or set 0 (default) for same as InputChromaFormat) for layer %d") 560 ("AuxId%d", cfg_auxId, 0, MAX_LAYERS, "Auxilary picture ID for layer %d (0: Not aux pic, 1: Alpha plane, 2: Depth picture, 3: Cb enh, 4: Cr enh") 561 #endif 535 562 ("ConformanceMode%d", cfg_conformanceMode,0, MAX_LAYERS, "Window conformance mode (0: no cropping, 1:automatic padding, 2: padding, 3:cropping") 536 563 #if SCALABILITY_MASK_E0104 537 564 ("ScalabilityMask1", m_scalabilityMask[1], 0, "scalability_mask[1] (multiview)") 538 565 ("ScalabilityMask2", m_scalabilityMask[2], 1, "scalability_mask[2] (scalable)" ) 566 #if AUXILIARY_PICTURES 567 ("ScalabilityMask3", m_scalabilityMask[3], 0, "scalability_mask[3] (auxiliary pictures)" ) 568 #endif 539 569 #else 540 570 ("ScalabilityMask0", m_scalabilityMask[0], 0, "scalability_mask[0] (multiview)") … … 597 627 ("OutputBitDepthC", m_outputBitDepthC, 0, "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)") 598 628 ("InternalBitDepthC", m_internalBitDepthC, 0, "As per InternalBitDepth but for chroma component. (default:IntrenalBitDepth)") 629 #if AUXILIARY_PICTURES 630 ("InputChromaFormat", tmpInputChromaFormat, 420, "InputChromaFormatIDC") 631 ("ChromaFormatIDC,-cf", tmpChromaFormat, 0, "ChromaFormatIDC (400|420|422|444 or set 0 (default) for same as InputChromaFormat)") 632 #endif 599 633 ("ConformanceMode", m_conformanceMode, 0, "Window conformance mode (0: no window, 1:automatic padding, 2:padding, 3:conformance") 600 634 ("HorizontalPadding,-pdx",m_aiPad[0], 0, "Horizontal source padding for conformance window mode 2") … … 1211 1245 m_acLayerCfg[layer].m_refLayerIds = NULL; 1212 1246 } 1247 } 1248 #endif 1249 #if AUXILIARY_PICTURES 1250 for(UInt layer = 0; layer < MAX_LAYERS; layer++) 1251 { 1252 m_acLayerCfg[layer].m_InputChromaFormat = numberToChromaFormat(cfg_tmpChromaFormatIDC[layer]); 1253 m_acLayerCfg[layer].m_chromaFormatIDC = ((cfg_tmpChromaFormatIDC[layer] == 0) ? (m_acLayerCfg[layer].m_InputChromaFormat ) : (numberToChromaFormat(cfg_tmpChromaFormatIDC[layer]))); 1213 1254 } 1214 1255 #endif … … 2251 2292 } 2252 2293 #endif 2294 #if AUXILIARY_PICTURES 2295 for (UInt layer=0; layer < MAX_LAYERS-1; layer++) 2296 { 2297 xConfirmPara(m_acLayerCfg[layer].m_auxId < 0 || m_acLayerCfg[layer].m_auxId > 4, "AuxId must be in range 0 to 4"); 2298 xConfirmPara(m_acLayerCfg[layer].m_auxId > 0 && m_acLayerCfg[layer].m_chromaFormatIDC != CHROMA_400, "Auxiliary picture must be monochrome picture"); 2299 } 2300 #endif 2253 2301 #undef xConfirmPara 2254 2302 if (check_failed) … … 2331 2379 printf("Multiview : %d\n", m_scalabilityMask[1] ); 2332 2380 printf("Scalable : %d\n", m_scalabilityMask[2] ); 2381 #if AUXILIARY_PICTURES 2382 printf("Auxiliary pictures : %d\n", m_scalabilityMask[3] ); 2383 #endif 2333 2384 #else 2334 2385 printf("Multiview : %d\n", m_scalabilityMask[0] ); -
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.h
r471 r475 101 101 Int m_aiPad[2]; ///< number of padded pixels for width and height 102 102 #endif 103 103 #if AUXILIARY_PICTURES 104 ChromaFormat m_InputChromaFormatIDC; 105 #endif 104 106 Bool m_isField; ///< enable field coding 105 107 Bool m_isTopFieldFirst; … … 172 174 Int m_internalBitDepthY; ///< bit-depth codec operates at in luma (input/output files will be converted) 173 175 Int m_internalBitDepthC; ///< bit-depth codec operates at in chroma (input/output files will be converted) 176 #endif 177 #if AUXILIARY_PICTURES 178 ChromaFormat m_chromaFormatIDC; 174 179 #endif 175 180 -
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp
r468 r475 22 22 //! \{ 23 23 24 25 #if AUXILIARY_PICTURES 26 static inline ChromaFormat numberToChromaFormat(const Int val) 27 { 28 switch (val) 29 { 30 case 400: return CHROMA_400; break; 31 case 420: return CHROMA_420; break; 32 case 422: return CHROMA_422; break; 33 case 444: return CHROMA_444; break; 34 default: return NUM_CHROMA_FORMAT; 35 } 36 } 37 #endif 24 38 25 39 // ==================================================================================================================== … … 75 89 string cfg_ReconFile; 76 90 string cfg_dQPFile; 91 #if AUXILIARY_PICTURES 92 Int tmpInputChromaFormat; 93 Int tmpChromaFormat; 94 #endif 95 77 96 po::Options opts; 78 97 opts.addOptions() … … 85 104 ("SourceHeight,-hgt", m_iSourceHeight, 0, "Source picture height") 86 105 ("CroppingMode", m_conformanceMode, 0, "Cropping mode (0: no cropping, 1:automatic padding, 2: padding, 3:cropping") 106 #if AUXILIARY_PICTURES 107 ("InputChromaFormat", tmpInputChromaFormat, 420, "InputChromaFormatIDC") 108 ("ChromaFormatIDC", tmpChromaFormat, 420, "ChromaFormatIDC (400|420|422|444 or set 0 (default) for same as InputChromaFormat)") 109 #endif 87 110 ("CropLeft", m_confLeft, 0, "Left cropping/padding for cropping mode 3") 88 111 ("CropRight", m_confRight, 0, "Right cropping/padding for cropping mode 3") … … 103 126 m_cReconFile = cfg_ReconFile; 104 127 m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str()); 128 #if AUXILIARY_PICTURES 129 m_InputChromaFormat = numberToChromaFormat(tmpInputChromaFormat); 130 m_chromaFormatIDC = ((tmpChromaFormat == 0) ? (m_InputChromaFormat) : (numberToChromaFormat(tmpChromaFormat))); 131 #endif 105 132 106 133 // reading external dQP description from file -
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncLayerCfg.h
r471 r475 44 44 Double m_fQP; ///< QP value of key-picture (floating point) 45 45 #if SVC_EXTENSION 46 #if AUXILIARY_PICTURES 47 ChromaFormat m_chromaFormatIDC; 48 ChromaFormat m_InputChromaFormat; 49 Int m_auxId; 50 #endif 46 51 #if VPS_EXTN_DIRECT_REF_LAYERS 47 52 #if M0457_PREDICTION_INDICATIONS … … 141 146 Int getConfTop() {return m_confTop; } 142 147 Int getConfBottom() {return m_confBottom; } 148 #if AUXILIARY_PICTURES 149 ChromaFormat getInputChromaFormat() {return m_InputChromaFormat;} 150 ChromaFormat getChromaFormatIDC() {return m_chromaFormatIDC; } 151 Int getAuxId() {return m_auxId; } 152 #endif 143 153 144 154 Int getIntQP() {return m_iQP; } -
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncTop.cpp
r471 r475 103 103 for( UInt idx = 0; idx < layer; idx++ ) 104 104 { 105 #if AUXILIARY_PICTURES 106 if( m_acLayerCfg[layer].getSourceWidth() == m_acLayerCfg[idx].getSourceWidth() && m_acLayerCfg[layer].getSourceHeight() == m_acLayerCfg[idx].getSourceHeight() && 107 m_acLayerCfg[layer].getChromaFormatIDC() == m_acLayerCfg[idx].getChromaFormatIDC() ) 108 #else 105 109 if( m_acLayerCfg[layer].getSourceWidth() == m_acLayerCfg[idx].getSourceWidth() && m_acLayerCfg[layer].getSourceHeight() == m_acLayerCfg[idx].getSourceHeight() ) 110 #endif 106 111 { 107 112 found = true; … … 144 149 repFormat->setPicWidthVpsInLumaSamples ( m_acLayerCfg[mapIdxToLayer[idx]].getSourceWidth() ); 145 150 repFormat->setPicHeightVpsInLumaSamples ( m_acLayerCfg[mapIdxToLayer[idx]].getSourceHeight() ); 151 #if AUXILIARY_PICTURES 152 repFormat->setChromaFormatVpsIdc ( m_acLayerCfg[mapIdxToLayer[idx]].getChromaFormatIDC() ); 153 #else 146 154 repFormat->setChromaFormatVpsIdc ( 1 ); // Need modification to change for each layer - corresponds to 420 155 #endif 147 156 repFormat->setSeparateColourPlaneVpsFlag( 0 ); // Need modification to change for each layer 148 157 #if O0194_DIFFERENT_BITDEPTH_EL_BL … … 595 604 m_acTEncTop[layer].setAdaptiveResolutionChange( m_adaptiveResolutionChange ); 596 605 #endif 606 #if AUXILIARY_PICTURES 607 m_acTEncTop[layer].setChromaFormatIDC( m_acLayerCfg[layer].m_chromaFormatIDC ); 608 #endif 597 609 } 598 610 } … … 1025 1037 scalabilityTypes += m_scalabilityMask[i]; 1026 1038 } 1039 #if AUXILIARY_PICTURES 1040 assert( scalabilityTypes <= 2 ); 1041 #else 1027 1042 assert( scalabilityTypes == 1 ); 1043 #endif 1028 1044 vps->setNumScalabilityTypes(scalabilityTypes); 1029 1045 } … … 1046 1062 vps->setDimensionId(i, 0, i); 1047 1063 } 1064 #if AUXILIARY_PICTURES 1065 if (m_scalabilityMask[3]) 1066 { 1067 UInt maxAuxId = 0; 1068 UInt auxDimIdLen = 0; 1069 for(i = 1; i < vps->getMaxLayers(); i++) 1070 { 1071 if (m_acLayerCfg[i].getAuxId() > maxAuxId) 1072 { 1073 maxAuxId = m_acLayerCfg[i].getAuxId(); 1074 } 1075 } 1076 while((1 << auxDimIdLen) < (maxAuxId + 1)) 1077 { 1078 auxDimIdLen++; 1079 } 1080 vps->setDimensionIdLen(1, auxDimIdLen); 1081 for(i = 1; i < vps->getMaxLayers(); i++) 1082 { 1083 vps->setDimensionId(i, 1, m_acLayerCfg[i].getAuxId()); 1084 } 1085 } 1086 #endif 1048 1087 #endif 1049 1088 #if N0120_MAX_TID_REF_PRESENT_FLAG … … 1255 1294 #if SVC_UPSAMPLING 1256 1295 #if LAYER_CTB 1296 #if AUXILIARY_PICTURES 1297 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL ); 1298 #else 1257 1299 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL ); 1300 #endif 1301 #else 1302 #if AUXILIARY_PICTURES 1303 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].getChromaFormatIDC(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1258 1304 #else 1259 1305 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1306 #endif 1260 1307 #endif 1261 1308 #else … … 1267 1314 #if SVC_UPSAMPLING 1268 1315 #if LAYER_CTB 1316 #if AUXILIARY_PICTURES 1317 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL ); 1318 #else 1269 1319 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL ); 1320 #endif 1321 #else 1322 #if AUXILIARY_PICTURES 1323 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1270 1324 #else 1271 1325 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1326 #endif 1272 1327 #endif 1273 1328 #else … … 1325 1380 // read input YUV file 1326 1381 m_acTVideoIOYuvInputFile[layer].read( pcPicYuvOrg[layer], m_acLayerCfg[layer].getPad() ); 1382 1383 #if AUXILIARY_PICTURES 1384 if (m_acLayerCfg[layer].getChromaFormatIDC() == CHROMA_400) 1385 { 1386 pcPicYuvOrg[layer]->convertToMonochrome(); 1387 } 1388 #endif 1327 1389 1328 1390 if(layer == m_numLayers-1) … … 1680 1742 #if SVC_UPSAMPLING 1681 1743 #if LAYER_CTB 1744 #if AUXILIARY_PICTURES 1745 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL ); 1746 #else 1682 1747 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL ); 1748 #endif 1749 #else 1750 #if AUXILIARY_PICTURES 1751 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1683 1752 #else 1684 1753 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1754 #endif 1685 1755 #endif 1686 1756 #else
Note: See TracChangeset for help on using the changeset viewer.