- Timestamp:
- 15 Nov 2013, 14:55:37 (11 years ago)
- Location:
- branches/SHM-4.0-dev
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-4.0-dev/cfg/layers.cfg
r442 r475 3 3 ScalabilityMask1 : 0 # Multiview 4 4 ScalabilityMask2 : 1 # Scalable 5 ScalabilityMask3 : 1 # Auxiliary pictures 5 6 AdaptiveResolutionChange : 0 # Resolution change frame (0: disable) 6 7 MaxTidRefPresentFlag : 1 # max_tid_ref_present_flag (0=not present, 1=present(default)) -
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 -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPic.cpp
r459 r475 79 79 } 80 80 #if SVC_UPSAMPLING 81 #if AUXILIARY_PICTURES 82 Void TComPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 83 Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual) 84 #else 81 85 Void TComPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 82 86 Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual) 83 87 #endif 84 88 { 85 89 m_apcPicSym = new TComPicSym; m_apcPicSym ->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth ); 86 90 if (!bIsVirtual) 87 91 { 92 #if AUXILIARY_PICTURES 93 m_apcPicYuv[0] = new TComPicYuv; m_apcPicYuv[0]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 94 #else 88 95 m_apcPicYuv[0] = new TComPicYuv; m_apcPicYuv[0]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 89 } 96 #endif 97 } 98 #if AUXILIARY_PICTURES 99 m_apcPicYuv[1] = new TComPicYuv; m_apcPicYuv[1]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 100 #else 90 101 m_apcPicYuv[1] = new TComPicYuv; m_apcPicYuv[1]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 102 #endif 91 103 92 104 for( Int i = 0; i < MAX_LAYERS; i++ ) … … 94 106 if( m_bSpatialEnhLayer[i] ) 95 107 { 108 #if AUXILIARY_PICTURES 109 m_pcFullPelBaseRec[i] = new TComPicYuv; m_pcFullPelBaseRec[i]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 110 #else 96 111 m_pcFullPelBaseRec[i] = new TComPicYuv; m_pcFullPelBaseRec[i]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 112 #endif 97 113 } 98 114 } … … 407 423 { 408 424 m_pNDBFilterYuvTmp = new TComPicYuv(); 425 #if AUXILIARY_PICTURES 426 m_pNDBFilterYuvTmp->create(picWidth, picHeight, getChromaFormat(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth); 427 #else 409 428 m_pNDBFilterYuvTmp->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth); 429 #endif 430 410 431 } 411 432 -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPic.h
r459 r475 102 102 virtual ~TComPic(); 103 103 104 #if AUXILIARY_PICTURES 105 #if SVC_UPSAMPLING 106 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 107 Int *numReorderPics, TComSPS* pcSps = NULL, Bool bIsVirtual = false ); 108 #else 109 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 110 Int *numReorderPics, Bool bIsVirtual = false ); 111 #endif 112 #else 104 113 #if SVC_UPSAMPLING 105 114 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, … … 108 117 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 109 118 Int *numReorderPics, Bool bIsVirtual = false ); 119 #endif 110 120 #endif 111 121 virtual Void destroy(); … … 166 176 167 177 Int getStride() { return m_apcPicYuv[1]->getStride(); } 178 #if AUXILIARY_PICTURES 179 ChromaFormat getChromaFormat() const { return m_apcPicYuv[1]->getChromaFormat(); } 180 #endif 168 181 Int getCStride() { return m_apcPicYuv[1]->getCStride(); } 169 182 -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPicYuv.cpp
r467 r475 67 67 { 68 68 } 69 #if AUXILIARY_PICTURES 70 #if SVC_UPSAMPLING 71 Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps ) 72 #else 73 Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth ) 74 #endif 75 #else 69 76 #if SVC_UPSAMPLING 70 77 Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps ) 71 78 #else 72 79 Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth ) 80 #endif 73 81 #endif 74 82 { … … 86 94 m_iCuWidth = uiMaxCUWidth; 87 95 m_iCuHeight = uiMaxCUHeight; 96 #if AUXILIARY_PICTURES 97 m_chromaFormatIDC = chromaFormatIDC; 98 #endif 88 99 89 100 Int numCuInWidth = m_iPicWidth / m_iCuWidth + (m_iPicWidth % m_iCuWidth != 0); … … 239 250 } 240 251 252 #if AUXILIARY_PICTURES 253 Void TComPicYuv::convertToMonochrome() 254 { 255 Int numPix = ((m_iPicWidth >> 1) + (m_iChromaMarginX << 1)) * ((m_iPicHeight >> 1) + (m_iChromaMarginY << 1)); 256 Pel grayVal = (1 << (g_bitDepthC - 1)); 257 258 for (UInt i = 0; i < numPix; i++) 259 { 260 m_apiPicBufU[i] = grayVal; 261 m_apiPicBufV[i] = grayVal; 262 } 263 } 264 #endif 265 241 266 Void TComPicYuv::extendPicBorder () 242 267 { -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPicYuv.h
r313 r475 75 75 Int m_iPicWidth; ///< Width of picture 76 76 Int m_iPicHeight; ///< Height of picture 77 #if AUXILIARY_PICTURES 78 ChromaFormat m_chromaFormatIDC; ////< Chroma Format 79 #endif 77 80 78 81 Int m_iCuWidth; ///< Width of Coding Unit (CU) … … 108 111 // Memory management 109 112 // ------------------------------------------------------------------------------------------------ 113 #if AUXILIARY_PICTURES 114 #if SVC_UPSAMPLING 115 Void create ( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps = NULL); 116 #else 117 Void create ( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth ); 118 #endif 119 #else 110 120 #if SVC_UPSAMPLING 111 121 Void create ( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps = NULL); … … 113 123 Void create ( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth ); 114 124 #endif 125 #endif 115 126 116 127 Void destroy (); … … 125 136 Int getWidth () { return m_iPicWidth; } 126 137 Int getHeight () { return m_iPicHeight; } 138 #if AUXILIARY_PICTURES 139 ChromaFormat getChromaFormat () const { return m_chromaFormatIDC; } 140 #endif 127 141 128 142 #if SVC_EXTENSION … … 184 198 #endif 185 199 200 #if AUXILIARY_PICTURES 201 Void convertToMonochrome(); 202 #endif 203 186 204 // Set border extension flag 187 205 Void setBorderExtension(Bool b) { m_bIsBorderExtended = b; } -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComSlice.cpp
r470 r475 1840 1840 return retVal; 1841 1841 } 1842 #if AUXILIARY_PICTURES 1843 ChromaFormat TComSlice::getChromaFormatIdc() 1844 #else 1842 1845 UInt TComSlice::getChromaFormatIdc() 1846 #endif 1847 { 1848 TComSPS *sps = getSPS(); 1849 TComVPS *vps = getVPS(); 1850 #if AUXILIARY_PICTURES 1851 ChromaFormat retVal; 1852 UInt layerId = getLayerId(); 1853 #else 1854 UInt retVal, layerId = getLayerId(); 1855 #endif 1856 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1857 { 1858 retVal = sps->getChromaFormatIdc(); 1859 } 1860 else 1861 { 1862 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getChromaFormatVpsIdc(); 1863 } 1864 return retVal; 1865 } 1866 UInt TComSlice::getBitDepthY() 1843 1867 { 1844 1868 TComSPS *sps = getSPS(); … … 1847 1871 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1848 1872 { 1849 retVal = sps->get ChromaFormatIdc();1873 retVal = sps->getBitDepthY(); 1850 1874 } 1851 1875 else 1852 1876 { 1853 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->get ChromaFormatVpsIdc();1877 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVpsLuma(); 1854 1878 } 1855 1879 return retVal; 1856 1880 } 1857 UInt TComSlice::getBitDepth Y()1881 UInt TComSlice::getBitDepthC() 1858 1882 { 1859 1883 TComSPS *sps = getSPS(); … … 1862 1886 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1863 1887 { 1864 retVal = sps->getBitDepth Y();1888 retVal = sps->getBitDepthC(); 1865 1889 } 1866 1890 else 1867 1891 { 1868 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVps Luma();1892 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVpsChroma(); 1869 1893 } 1870 1894 return retVal; 1871 1895 } 1872 UInt TComSlice::getBitDepthC()1873 {1874 TComSPS *sps = getSPS();1875 TComVPS *vps = getVPS();1876 UInt retVal, layerId = getLayerId();1877 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() )1878 {1879 retVal = sps->getBitDepthC();1880 }1881 else1882 {1883 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVpsChroma();1884 }1885 return retVal;1886 }1887 1896 Int TComSlice::getQpBDOffsetY() 1888 1897 { … … 1895 1904 1896 1905 RepFormat::RepFormat() 1906 #if AUXILIARY_PICTURES 1907 : m_chromaFormatVpsIdc (CHROMA_420) 1908 #else 1897 1909 : m_chromaFormatVpsIdc (0) 1910 #endif 1898 1911 , m_separateColourPlaneVpsFlag (false) 1899 1912 , m_picWidthVpsInLumaSamples (0) -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComSlice.h
r466 r475 436 436 class RepFormat 437 437 { 438 #if AUXILIARY_PICTURES 439 ChromaFormat m_chromaFormatVpsIdc; 440 #else 438 441 Int m_chromaFormatVpsIdc; 442 #endif 439 443 Bool m_separateColourPlaneVpsFlag; 440 444 Int m_picWidthVpsInLumaSamples; … … 446 450 RepFormat(); 447 451 452 #if AUXILIARY_PICTURES 453 ChromaFormat getChromaFormatVpsIdc() { return m_chromaFormatVpsIdc; } 454 Void setChromaFormatVpsIdc(ChromaFormat x) { m_chromaFormatVpsIdc = x; } 455 #else 448 456 Int getChromaFormatVpsIdc() { return m_chromaFormatVpsIdc; } 449 457 Void setChromaFormatVpsIdc(Int x) { m_chromaFormatVpsIdc = x; } 458 #endif 450 459 451 460 Bool getSeparateColourPlaneVpsFlag() { return m_separateColourPlaneVpsFlag; } … … 1072 1081 Int m_SPSId; 1073 1082 Int m_VPSId; 1083 #if AUXILIARY_PICTURES 1084 ChromaFormat m_chromaFormatIdc; 1085 #else 1074 1086 Int m_chromaFormatIdc; 1087 #endif 1075 1088 1076 1089 UInt m_uiMaxTLayers; // maximum number of temporal layers … … 1182 1195 Int getSPSId () { return m_SPSId; } 1183 1196 Void setSPSId (Int i) { m_SPSId = i; } 1197 #if AUXILIARY_PICTURES 1198 ChromaFormat getChromaFormatIdc () { return m_chromaFormatIdc; } 1199 #else 1184 1200 Int getChromaFormatIdc () { return m_chromaFormatIdc; } 1185 Void setChromaFormatIdc (Int i) { m_chromaFormatIdc = i; } 1186 1201 #endif 1202 Void setChromaFormatIdc (ChromaFormat i) { m_chromaFormatIdc = i; } 1203 1204 #if AUXILIARY_PICTURES 1205 static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc >= 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc]; } 1206 static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc >= 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc]; } 1207 #else 1187 1208 static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc]; } 1188 1209 static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc]; } 1210 #endif 1189 1211 1190 1212 // structure … … 2069 2091 UInt getPicWidthInLumaSamples(); 2070 2092 UInt getPicHeightInLumaSamples(); 2093 #if AUXILIARY_PICTURES 2094 ChromaFormat getChromaFormatIdc(); 2095 #else 2071 2096 UInt getChromaFormatIdc(); 2097 #endif 2072 2098 UInt getBitDepthY(); 2073 2099 UInt getBitDepthC(); -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TypeDef.h
r470 r475 153 153 154 154 #define O0215_PHASE_ALIGNMENT 1 // JCTVC_O0215: signal a flag to specify phase alignment case, 0: zero-position-aligned, 1: central-position-aligned, 155 #define AUXILIARY_PICTURES 1 155 156 156 157 #else … … 464 465 CHROMA_422 = 2, 465 466 CHROMA_444 = 3 467 #if AUXILIARY_PICTURES 468 ,NUM_CHROMA_FORMAT = 4 469 #endif 466 470 }; 467 471 -
branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r468 r475 602 602 { 603 603 #endif 604 #if AUXILIARY_PICTURES 605 READ_UVLC( uiCode, "chroma_format_idc" ); pcSPS->setChromaFormatIdc( ChromaFormat(uiCode) ); 606 #else 604 607 READ_UVLC( uiCode, "chroma_format_idc" ); pcSPS->setChromaFormatIdc( uiCode ); 608 #endif 605 609 assert(uiCode <= 3); 606 610 // in the first version we only support chroma_format_idc equal to 1 (4:2:0), so separate_colour_plane_flag cannot appear in the bitstream … … 1049 1053 { 1050 1054 READ_CODE( vps->getDimensionIdLen(j), uiCode, "dimension_id[i][j]" ); vps->setDimensionId(i, j, uiCode); 1055 #if !AUXILIARY_PICTURES 1051 1056 assert( uiCode <= vps->getMaxLayerId() ); 1057 #endif 1052 1058 } 1053 1059 } … … 1306 1312 { 1307 1313 UInt uiCode; 1314 #if AUXILIARY_PICTURES 1315 READ_CODE( 2, uiCode, "chroma_format_idc" ); repFormat->setChromaFormatVpsIdc( ChromaFormat(uiCode) ); 1316 #else 1308 1317 READ_CODE( 2, uiCode, "chroma_format_idc" ); repFormat->setChromaFormatVpsIdc( uiCode ); 1309 1318 #endif 1319 1310 1320 if( repFormat->getChromaFormatVpsIdc() == 3 ) 1311 1321 { … … 1808 1818 { 1809 1819 READ_FLAG(uiCode, "slice_sao_luma_flag"); rpcSlice->setSaoEnabledFlag((Bool)uiCode); 1820 #if AUXILIARY_PICTURES 1821 ChromaFormat format; 1822 #if REPN_FORMAT_IN_VPS 1823 if( ( sps->getLayerId() == 0 ) || sps->getUpdateRepFormatFlag() ) 1824 { 1825 format = sps->getChromaFormatIdc(); 1826 } 1827 else 1828 { 1829 format = rpcSlice->getVPS()->getVpsRepFormat( rpcSlice->getVPS()->getVpsRepFormatIdx(sps->getLayerId()) )->getChromaFormatVpsIdc(); 1830 } 1831 #else 1832 format = sps->getChromaFormatIdc(); 1833 #endif 1834 if (format != CHROMA_400) 1835 { 1836 #endif 1810 1837 READ_FLAG(uiCode, "slice_sao_chroma_flag"); rpcSlice->setSaoEnabledFlagChroma((Bool)uiCode); 1838 #if AUXILIARY_PICTURES 1839 } 1840 else 1841 { 1842 rpcSlice->setSaoEnabledFlagChroma(false); 1843 } 1844 #endif 1811 1845 } 1812 1846 … … 2411 2445 2412 2446 Int iDeltaDenom; 2447 #if AUXILIARY_PICTURES 2448 if (pcSlice->getChromaFormatIdc() == CHROMA_400) 2449 { 2450 bChroma = false; 2451 } 2452 #endif 2413 2453 // decode delta_luma_log2_weight_denom : 2414 2454 READ_UVLC( uiLog2WeightDenomLuma, "luma_log2_weight_denom" ); // ue(v): luma_log2_weight_denom … … 2430 2470 2431 2471 wp[0].uiLog2WeightDenom = uiLog2WeightDenomLuma; 2472 #if AUXILIARY_PICTURES 2473 if (!bChroma) 2474 { 2475 wp[1].uiLog2WeightDenom = 0; 2476 wp[2].uiLog2WeightDenom = 0; 2477 } 2478 else 2479 { 2480 #endif 2432 2481 wp[1].uiLog2WeightDenom = uiLog2WeightDenomChroma; 2433 2482 wp[2].uiLog2WeightDenom = uiLog2WeightDenomChroma; 2483 #if AUXILIARY_PICTURES 2484 } 2485 #endif 2434 2486 2435 2487 UInt uiCode; -
branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecSbac.cpp
r442 r475 356 356 uiHeight = pcCU->getHeight(uiAbsPartIdx)/2; 357 357 uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthChroma(); 358 #if AUXILIARY_PICTURES 359 ChromaFormat format = pcCU->getSlice()->getChromaFormatIdc(); 360 UInt uiGrayVal = 1 << (uiSampleBits - 1); 361 #endif 358 362 359 363 for(uiY = 0; uiY < uiHeight; uiY++) … … 362 366 { 363 367 UInt uiSample; 368 #if AUXILIARY_PICTURES 369 if (format == CHROMA_400) 370 uiSample = uiGrayVal; 371 else 372 #endif 364 373 m_pcTDecBinIf->xReadPCMCode(uiSampleBits, uiSample); 365 374 piPCMSample[uiX] = uiSample; … … 378 387 { 379 388 UInt uiSample; 389 #if AUXILIARY_PICTURES 390 if (format == CHROMA_400) 391 uiSample = uiGrayVal; 392 else 393 #endif 380 394 m_pcTDecBinIf->xReadPCMCode(uiSampleBits, uiSample); 381 395 piPCMSample[uiX] = uiSample; … … 665 679 UInt uiSymbol; 666 680 681 #if AUXILIARY_PICTURES 682 if ( pcCU->getSlice()->getChromaFormatIdc() == CHROMA_400 ) 683 { 684 uiSymbol = DC_IDX; 685 } 686 else 687 { 688 #endif 667 689 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUChromaPredSCModel.get( 0, 0, 0 ) ); 668 690 … … 681 703 } 682 704 } 705 #if AUXILIARY_PICTURES 706 } 707 #endif 683 708 pcCU->setChromIntraDirSubParts( uiSymbol, uiAbsPartIdx, uiDepth ); 684 709 return; … … 885 910 UInt uiSymbol; 886 911 const UInt uiCtx = pcCU->getCtxQtCbf( eType, uiTrDepth ); 912 #if AUXILIARY_PICTURES 913 if (pcCU->getSlice()->getChromaFormatIdc() == CHROMA_400 && (eType == TEXT_CHROMA_U || eType == TEXT_CHROMA_V)) 914 { 915 uiSymbol = 0; 916 } 917 else 918 { 919 #endif 887 920 m_pcTDecBinIf->decodeBin( uiSymbol , m_cCUQtCbfSCModel.get( 0, eType ? TEXT_CHROMA: eType, uiCtx ) ); 921 #if AUXILIARY_PICTURES 922 } 923 #endif 888 924 889 925 DTRACE_CABAC_VL( g_nSymbolCounter++ ) -
branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecTop.cpp
r464 r475 179 179 180 180 m_cIlpPic[j] = new TComPic; 181 #if AUXILIARY_PICTURES 182 #if REPN_FORMAT_IN_VPS 183 #if SVC_UPSAMPLING 184 m_cIlpPic[j]->create(picWidth, picHeight, slice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true); 185 #else 186 m_cIlpPic[j]->create(picWidth, picHeight, slice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true); 187 #endif 188 #else 189 #if SVC_UPSAMPLING 190 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), pcSPS->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true); 191 #else 192 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), pcSPS->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true); 193 #endif 194 #endif 195 #else 181 196 #if REPN_FORMAT_IN_VPS 182 197 #if SVC_UPSAMPLING … … 190 205 #else 191 206 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true); 207 #endif 192 208 #endif 193 209 #endif … … 291 307 #endif 292 308 309 #if AUXILIARY_PICTURES 310 #if REPN_FORMAT_IN_VPS 311 #if SVC_UPSAMPLING 312 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 313 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 314 #else 315 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 316 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 317 #endif 318 #else 319 #if SVC_UPSAMPLING 320 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 321 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 322 #else 323 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 324 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 325 #endif 326 #endif 327 #else 293 328 #if REPN_FORMAT_IN_VPS 294 329 #if SVC_UPSAMPLING … … 308 343 #endif 309 344 #endif 345 #endif 310 346 311 347 rpcPic->getPicSym()->allocSaoParam(&m_cSAO); … … 348 384 rpcPic->destroy(); 349 385 386 #if AUXILIARY_PICTURES 387 #if REPN_FORMAT_IN_VPS 388 #if SVC_UPSAMPLING 389 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 390 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 391 392 #else 393 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 394 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 395 #endif 396 #else 397 #if SVC_UPSAMPLING 398 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 399 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 400 401 #else 402 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 403 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 404 #endif 405 #endif 406 #else 350 407 #if REPN_FORMAT_IN_VPS 351 408 #if SVC_UPSAMPLING … … 365 422 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 366 423 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 424 #endif 367 425 #endif 368 426 #endif … … 1526 1584 Window &conformanceWindow = sps->getConformanceWindow(); 1527 1585 Window defaultDisplayWindow = sps->getVuiParametersPresentFlag() ? sps->getVuiParameters()->getDefaultDisplayWindow() : Window(); 1586 #if AUXILIARY_PICTURES 1528 1587 #if SVC_UPSAMPLING 1529 1588 #if AVC_SYNTAX 1530 1589 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, sps, true); 1590 #else 1591 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, NULL, true); 1592 #endif 1593 #else 1594 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), onformanceWindow, defaultDisplayWindow, numReorderPics, true); 1595 #endif 1596 #else 1597 #if SVC_UPSAMPLING 1598 #if AVC_SYNTAX 1531 1599 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, sps, true); 1532 1600 #else … … 1535 1603 #else 1536 1604 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), onformanceWindow, defaultDisplayWindow, numReorderPics, true); 1605 #endif 1537 1606 #endif 1538 1607 } -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r467 r475 1221 1221 } 1222 1222 1223 #if !AUXILIARY_PICTURES 1223 1224 #if REPN_FORMAT_IN_VPS 1224 1225 // in the first version chroma_format_idc is equal to one, thus colour_plane_id will not be present … … 1227 1228 // in the first version chroma_format_idc is equal to one, thus colour_plane_id will not be present 1228 1229 assert (pcSlice->getSPS()->getChromaFormatIdc() == 1 ); 1230 #endif 1229 1231 #endif 1230 1232 // if( separate_colour_plane_flag == 1 ) … … 1428 1430 WRITE_FLAG( pcSlice->getSaoEnabledFlag(), "slice_sao_luma_flag" ); 1429 1431 { 1432 #if AUXILIARY_PICTURES 1433 if (pcSlice->getChromaFormatIdc() != CHROMA_400) 1434 { 1435 #endif 1430 1436 SAOParam *saoParam = pcSlice->getPic()->getPicSym()->getSaoParam(); 1431 1437 WRITE_FLAG( saoParam->bSaoFlag[1], "slice_sao_chroma_flag" ); 1438 #if AUXILIARY_PICTURES 1439 } 1440 #endif 1432 1441 } 1433 1442 } … … 1894 1903 UInt uiMode = 0; 1895 1904 UInt uiTotalSignalledWeightFlags = 0; 1905 #if AUXILIARY_PICTURES 1906 if (pcSlice->getChromaFormatIdc() == CHROMA_400) 1907 { 1908 bChroma = false; 1909 } 1910 #endif 1896 1911 if ( (pcSlice->getSliceType()==P_SLICE && pcSlice->getPPS()->getUseWP()) || (pcSlice->getSliceType()==B_SLICE && pcSlice->getPPS()->getWPBiPred()) ) 1897 1912 { -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncCfg.h
r469 r475 211 211 Int m_chromaCbQpOffset; // Chroma Cb QP Offset (0:default) 212 212 Int m_chromaCrQpOffset; // Chroma Cr Qp Offset (0:default) 213 #if AUXILIARY_PICTURES 214 ChromaFormat m_chromaFormatIDC; 215 #endif 213 216 214 217 #if ADAPTIVE_QP_SELECTION … … 931 934 Int getAdaptiveResolutionChange() { return m_adaptiveResolutionChange; } 932 935 #endif 936 #if AUXILIARY_PICTURES 937 Void setChromaFormatIDC(ChromaFormat x) { m_chromaFormatIDC = x; } 938 ChromaFormat getChromaFormatIDC() { return m_chromaFormatIDC; } 939 #endif 933 940 #endif 934 941 }; -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncEntropy.cpp
r345 r475 280 280 const UInt uiTrDepthCurr = uiDepth - pcCU->getDepth( uiAbsPartIdx ); 281 281 const Bool bFirstCbfOfCU = uiTrDepthCurr == 0; 282 #if AUXILIARY_PICTURES 283 if (pcCU->getSlice()->getChromaFormatIdc() != CHROMA_400) 284 { 285 #endif 282 286 if( bFirstCbfOfCU || uiLog2TrafoSize > 2 ) 283 287 { … … 296 300 assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr - 1 ) ); 297 301 } 302 #if AUXILIARY_PICTURES 303 } 304 else 305 { 306 assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr ) == 0 ); 307 assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr ) == 0 ); 308 } 309 #endif 298 310 299 311 if( uiSubdiv ) … … 402 414 Void TEncEntropy::encodeIntraDirModeChroma( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 403 415 { 416 #if AUXILIARY_PICTURES 417 if ( pcCU->getSlice()->getChromaFormatIdc() == CHROMA_400 ) 418 { 419 return; 420 } 421 #endif 404 422 if( bRD ) 405 423 { -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r467 r475 3165 3165 3166 3166 TComPicYuv* pcOrgInterlaced = new TComPicYuv; 3167 #if AUXILIARY_PICTURES 3168 pcOrgInterlaced->create( iWidth, iHeight << 1, pcPicOrgTop->getChromaFormat(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 3169 #else 3167 3170 pcOrgInterlaced->create( iWidth, iHeight << 1, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 3171 #endif 3168 3172 3169 3173 TComPicYuv* pcRecInterlaced = new TComPicYuv; 3174 #if AUXILIARY_PICTURES 3175 pcRecInterlaced->create( iWidth, iHeight << 1, pcPicOrgTop->getChromaFormat(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 3176 #else 3170 3177 pcRecInterlaced->create( iWidth, iHeight << 1, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 3178 #endif 3171 3179 3172 3180 Pel* pOrgInterlaced = pcOrgInterlaced->getLumaAddr(); -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncPic.cpp
r313 r475 126 126 * \return Void 127 127 */ 128 #if AUXILIARY_PICTURES 129 #if SVC_UPSAMPLING 130 Void TEncPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 131 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual ) 132 133 #else 134 135 Void TEncPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 136 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual ) 137 #endif 138 { 139 #if SVC_UPSAMPLING 140 TComPic::create( iWidth, iHeight, chromaFormat, uiMaxWidth, uiMaxHeight, uiMaxDepth, 141 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSps, bIsVirtual ); 142 #else 143 TComPic::create( iWidth, iHeight, chromaFormat, uiMaxWidth, uiMaxHeight, uiMaxDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, bIsVirtual ); 144 #endif 145 m_uiMaxAQDepth = uiMaxAQDepth; 146 if ( uiMaxAQDepth > 0 ) 147 { 148 m_acAQLayer = new TEncPicQPAdaptationLayer[ m_uiMaxAQDepth ]; 149 for (UInt d = 0; d < m_uiMaxAQDepth; d++) 150 { 151 m_acAQLayer[d].create( iWidth, iHeight, uiMaxWidth>>d, uiMaxHeight>>d ); 152 } 153 } 154 } 155 #else 128 156 #if SVC_UPSAMPLING 129 157 Void TEncPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, … … 152 180 } 153 181 } 182 #endif 154 183 155 184 /** Clean up -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncPic.h
r313 r475 105 105 virtual ~TEncPic(); 106 106 107 #if AUXILIARY_PICTURES 108 #if SVC_UPSAMPLING 109 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 110 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual=false ); 111 #else 112 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 113 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual = false ); 114 115 #endif 116 #else 107 117 #if SVC_UPSAMPLING 108 118 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, … … 111 121 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 112 122 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual = false ); 123 #endif 113 124 #endif 114 125 virtual Void destroy(); -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp
r313 r475 1871 1871 1872 1872 saoParam->bSaoFlag[0] = true; 1873 #if AUXILIARY_PICTURES 1874 saoParam->bSaoFlag[1] = m_pcPic->getChromaFormat() == CHROMA_400 ? false : true; 1875 #else 1873 1876 saoParam->bSaoFlag[1] = true; 1877 #endif 1874 1878 saoParam->oneUnitFlag[0] = false; 1875 1879 saoParam->oneUnitFlag[1] = false; -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncSbac.cpp
r442 r475 914 914 } 915 915 916 #if AUXILIARY_PICTURES 917 if (pcCU->getSlice()->getChromaFormatIdc() != CHROMA_400) 918 { 919 #endif 916 920 piPCMSample = pcCU->getPCMSampleCb() + uiChromaOffset; 917 921 uiWidth = pcCU->getWidth(uiAbsPartIdx)/2; … … 945 949 piPCMSample += uiWidth; 946 950 } 951 #if AUXILIARY_PICTURES 952 } 953 #endif 947 954 m_pcBinIf->resetBac(); 948 955 } -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncSlice.cpp
r469 r475 79 79 } 80 80 81 #if AUXILIARY_PICTURES 82 Void TEncSlice::create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt iMaxCUWidth, UInt iMaxCUHeight, UChar uhTotalDepth ) 83 { 84 // create prediction picture 85 if ( m_apcPicYuvPred == NULL ) 86 { 87 m_apcPicYuvPred = new TComPicYuv; 88 m_apcPicYuvPred->create( iWidth, iHeight, chromaFormat, iMaxCUWidth, iMaxCUHeight, uhTotalDepth ); 89 } 90 91 // create residual picture 92 if( m_apcPicYuvResi == NULL ) 93 { 94 m_apcPicYuvResi = new TComPicYuv; 95 m_apcPicYuvResi->create( iWidth, iHeight, chromaFormat, iMaxCUWidth, iMaxCUHeight, uhTotalDepth ); 96 } 97 } 98 #else 81 99 Void TEncSlice::create( Int iWidth, Int iHeight, UInt iMaxCUWidth, UInt iMaxCUHeight, UChar uhTotalDepth ) 82 100 { … … 95 113 } 96 114 } 115 #endif 97 116 98 117 Void TEncSlice::destroy() -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncSlice.h
r442 r475 111 111 virtual ~TEncSlice(); 112 112 113 #if AUXILIARY_PICTURES 114 Void create ( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt iMaxCUWidth, UInt iMaxCUHeight, UChar uhTotalDepth ); 115 #else 113 116 Void create ( Int iWidth, Int iHeight, UInt iMaxCUWidth, UInt iMaxCUHeight, UChar uhTotalDepth ); 117 #endif 114 118 Void destroy (); 115 119 Void init ( TEncTop* pcEncTop ); -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncTop.cpp
r469 r475 115 115 m_cGOPEncoder. create(); 116 116 #endif 117 #if AUXILIARY_PICTURES 118 m_cSliceEncoder. create( getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 119 #else 117 120 m_cSliceEncoder. create( getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 121 #endif 118 122 m_cCuEncoder. create( g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight ); 119 123 if (m_bUseSAO) … … 606 610 else 607 611 { 612 #if AUXILIARY_PICTURES 613 rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 614 #else 608 615 rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 616 #endif 609 617 } 610 618 rcListPicYuvRecOut.pushBack( rpcPicYuvRec ); … … 806 814 #endif 807 815 816 #if AUXILIARY_PICTURES 817 #if SVC_UPSAMPLING 818 pcEPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 , 819 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics, &m_cSPS); 820 #else 821 pcEPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 , 822 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics); 823 #endif 824 #else 808 825 #if SVC_UPSAMPLING 809 826 pcEPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 , … … 812 829 pcEPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 , 813 830 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics); 831 #endif 814 832 #endif 815 833 rpcPic = pcEPic; … … 847 865 #endif 848 866 867 #if AUXILIARY_PICTURES 868 #if SVC_UPSAMPLING 869 rpcPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 870 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics, &m_cSPS); 871 #else 872 rpcPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 873 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics); 874 #endif 875 #else 849 876 #if SVC_UPSAMPLING 850 877 rpcPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, … … 853 880 rpcPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 854 881 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics); 882 #endif 855 883 #endif 856 884 } … … 917 945 m_cSPS.setMaxCUHeight ( g_uiMaxCUHeight ); 918 946 m_cSPS.setMaxCUDepth ( g_uiMaxCUDepth ); 947 #if AUXILIARY_PICTURES 948 m_cSPS.setChromaFormatIdc( m_chromaFormatIDC); 949 #endif 919 950 920 951 Int minCUSize = m_cSPS.getMaxCUWidth() >> ( m_cSPS.getMaxCUDepth()-g_uiAddCUDepth ); … … 1557 1588 m_cIlpPic[j] = new TComPic; 1558 1589 #if SVC_UPSAMPLING 1590 #if AUXILIARY_PICTURES 1591 m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true); 1592 #else 1559 1593 m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true); 1594 #endif 1560 1595 #else 1561 1596 m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true); … … 1609 1644 m_cIlpPic[j] = new TComPic; 1610 1645 #if SVC_UPSAMPLING 1646 #if AUXILIARY_PICTURES 1647 m_cIlpPic[j]->create(picWidth, picHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true); 1648 #else 1611 1649 m_cIlpPic[j]->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true); 1650 #endif 1612 1651 #else 1613 1652 m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true); -
branches/SHM-4.0-dev/source/Lib/TLibVideoIO/TVideoIOYuv.cpp
r442 r475 473 473 { 474 474 dstPicYuv = new TComPicYuv; 475 #if AUXILIARY_PICTURES 476 dstPicYuv->create( pPicYuv->getWidth(), pPicYuv->getHeight(), pPicYuv->getChromaFormat(), 1, 1, 0 ); 477 #else 475 478 dstPicYuv->create( pPicYuv->getWidth(), pPicYuv->getHeight(), 1, 1, 0 ); 479 #endif 476 480 pPicYuv->copyToPic(dstPicYuv); 477 481 … … 567 571 { 568 572 dstPicTop = new TComPicYuv; 573 #if AUXILIARY_PICTURES 574 dstPicTop->create( pPicTop->getWidth(), pPicTop->getHeight(), pPicTop->getChromaFormat(), 1, 1, 0 ); 575 #else 569 576 dstPicTop->create( pPicTop->getWidth(), pPicTop->getHeight(), 1, 1, 0 ); 577 #endif 570 578 pPicTop->copyToPic(dstPicTop); 571 579 572 580 dstPicBottom = new TComPicYuv; 581 #if AUXILIARY_PICTURES 582 dstPicBottom->create( pPicBottom->getWidth(), pPicBottom->getHeight(), pPicBottom->getChromaFormat(), 1, 1, 0 ); 583 #else 573 584 dstPicBottom->create( pPicBottom->getWidth(), pPicBottom->getHeight(), 1, 1, 0 ); 585 #endif 574 586 pPicBottom->copyToPic(dstPicBottom); 575 587
Note: See TracChangeset for help on using the changeset viewer.