Changeset 1287 in SHVCSoftware for branches/SHM-dev/source/App
- Timestamp:
- 17 Jul 2015, 05:43:37 (10 years ago)
- Location:
- branches/SHM-dev/source/App
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp
r1273 r1287 57 57 58 58 #if Q0074_COLOUR_REMAPPING_SEI 59 static Void applyColourRemapping(TComPicYuv& pic, const SEIColourRemappingInfo* colourRemappingInfoSEI, UInt layerId=0 );59 static Void applyColourRemapping(TComPicYuv& pic, const SEIColourRemappingInfo* colourRemappingInfoSEI, const BitDepths& bitDpeths, UInt layerId=0 ); 60 60 static std::vector<SEIColourRemappingInfo> storeCriSEI; //Persistent Colour Remapping Information SEI 61 61 static SEIColourRemappingInfo *seiColourRemappingInfoPrevious=NULL ; … … 290 290 #endif 291 291 { 292 // Set bitdepth for each layer when doing DBF293 g_bitDepth[CHANNEL_TYPE_LUMA] = g_bitDepthLayer[CHANNEL_TYPE_LUMA][curLayerId];294 g_bitDepth[CHANNEL_TYPE_CHROMA] = g_bitDepthLayer[CHANNEL_TYPE_CHROMA][curLayerId];295 296 292 if (!loopFiltered[curLayerId] || bitstreamFile) 297 293 { … … 322 318 if ( m_pchReconFile[curLayerId] && !openedReconFile[curLayerId] ) 323 319 { 320 const BitDepths &bitDepths=pcListPic->front()->getSlice(0)->getBitDepths(); // use bit depths of first reconstructed picture. 324 321 for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++) 325 322 { 326 323 if (m_outputBitDepth[channelType] == 0) 327 324 { 328 m_outputBitDepth[channelType] = g_bitDepth[channelType];325 m_outputBitDepth[channelType] = bitDepths.recon[channelType]; 329 326 } 330 327 } 331 m_acTVideoIOYuvReconFile[curLayerId].open( m_pchReconFile[curLayerId], true, m_outputBitDepth, m_outputBitDepth, g_bitDepth); // write mode328 m_acTVideoIOYuvReconFile[curLayerId].open( m_pchReconFile[curLayerId], true, m_outputBitDepth, m_outputBitDepth, bitDepths.recon ); // write mode 332 329 333 330 openedReconFile[curLayerId] = true; … … 541 538 if ( m_pchReconFile && !openedReconFile ) 542 539 { 540 const BitDepths &bitDepths=pcListPic->front()->getPicSym()->getSPS().getBitDepths(); // use bit depths of first reconstructed picture. 543 541 for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++) 544 542 { 545 543 if (m_outputBitDepth[channelType] == 0) 546 544 { 547 m_outputBitDepth[channelType] = g_bitDepth[channelType];545 m_outputBitDepth[channelType] = bitDepths.recon[channelType]; 548 546 } 549 547 } 550 548 551 m_cTVideoIOYuvReconFile.open( m_pchReconFile, true, m_outputBitDepth, m_outputBitDepth, g_bitDepth); // write mode549 m_cTVideoIOYuvReconFile.open( m_pchReconFile, true, m_outputBitDepth, m_outputBitDepth, bitDepths.recon ); // write mode 552 550 openedReconFile = true; 553 551 } … … 1298 1296 { 1299 1297 //printf ("\n\nColour Remapping is applied to POC : %d and LayerId : %d ",pic->getPOC(), pic->getLayerId()); 1300 applyColourRemapping(*pic->getPicYuvRec(), seiColourRemappingInfo1301 1298 #if SVC_EXTENSION 1302 , pic->getLayerId() 1303 #endif 1304 ); 1299 applyColourRemapping(*pic->getPicYuvRec(), seiColourRemappingInfo, pic->getSlice(0)->getBitDepths(), pic->getLayerId()); 1300 #else 1301 applyColourRemapping(*pic->getPicYuvRec(), seiColourRemappingInfo, pic->getSlice(0)->getBitDepths()); 1302 #endif 1305 1303 } 1306 1304 else // using the last CRI SEI received … … 1308 1306 const SEIColourRemappingInfo *seiColourRemappingInfoCopy; 1309 1307 seiColourRemappingInfoCopy = seiColourRemappingInfoPrevious; 1310 applyColourRemapping(*pic->getPicYuvRec(), seiColourRemappingInfoCopy1311 1308 #if SVC_EXTENSION 1312 , pic->getLayerId() 1313 #endif 1314 ); 1309 applyColourRemapping(*pic->getPicYuvRec(), seiColourRemappingInfoCopy, pic->getSlice(0)->getBitDepths(), pic->getLayerId()); 1310 #else 1311 applyColourRemapping(*pic->getPicYuvRec(), seiColourRemappingInfoCopy, pic->getSlice(0)->getBitDepths()); 1312 #endif 1315 1313 } 1316 1314 … … 1545 1543 1546 1544 TComPictureHash recon_digest; 1547 Int numChar = calcMD5(*pic->getPicYuvRec(), recon_digest );1545 Int numChar = calcMD5(*pic->getPicYuvRec(), recon_digest, pic->getSlice(0)->getBitDepths()); 1548 1546 fprintf(fptr, "%8d%9d MD5:%s\n", pic->getLayerId(), pic->getSlice(0)->getPOC(), hashToString(recon_digest, numChar).c_str()); 1549 1547 fclose(fptr); … … 1570 1568 if( this->getDecodedYuvLayerRefresh(layerId) ) 1571 1569 { 1572 m_outputBitDepth[CHANNEL_TYPE_LUMA] = g_bitDepth[CHANNEL_TYPE_LUMA] = g_bitDepthLayer[CHANNEL_TYPE_LUMA][layerId];1573 m_outputBitDepth[CHANNEL_TYPE_CHROMA] = g_bitDepth[CHANNEL_TYPE_CHROMA] = g_bitDepthLayer[CHANNEL_TYPE_CHROMA][layerId];1574 1575 1570 char tempFileName[256]; 1576 1571 strcpy(tempFileName, this->getDecodedYuvLayerFileName( layerId ).c_str()); 1577 m_confReconFile[layerId].open(tempFileName, true, m_outputBitDepth, m_outputBitDepth, g_bitDepth ); // write mode 1572 1573 const TComVPS *vps = m_acTDecTop->getLayerDec(layerId)->getParameterSetManager()->getActiveVPS(); 1574 const TComSPS *sps = m_acTDecTop->getLayerDec(layerId)->getParameterSetManager()->getActiveSPS(); 1575 const BitDepths &bitDpeths = vps->getBitDepths(sps, layerId); 1576 Int bitDepth[] = {bitDpeths.recon[CHANNEL_TYPE_LUMA], bitDpeths.recon[CHANNEL_TYPE_CHROMA]}; 1577 1578 m_confReconFile[layerId].open(tempFileName, true, m_outputBitDepth, m_outputBitDepth, bitDepth ); // write mode 1578 1579 this->setDecodedYuvLayerRefresh( layerId, false ); 1579 1580 } … … 1845 1846 1846 1847 #if Q0074_COLOUR_REMAPPING_SEI 1847 Void xInitColourRemappingLut( const Int bitDepthY, const Int bitDepthC, std::vector<Int>(&preLut)[3], std::vector<Int>(&postLut)[3], const SEIColourRemappingInfo* const pCriSEI )1848 Void xInitColourRemappingLut( const BitDepths &bitDepths, std::vector<Int>(&preLut)[3], std::vector<Int>(&postLut)[3], const SEIColourRemappingInfo* const pCriSEI ) 1848 1849 { 1849 1850 for ( Int c=0 ; c<3 ; c++ ) 1850 1851 { 1851 Int bitDepth = c ? bitDepthC : bitDepthY;1852 Int bitDepth = bitDepths.recon[toChannelType(ComponentID(c))]; 1852 1853 preLut[c].resize(1 << bitDepth); 1853 1854 postLut[c].resize(1 << pCriSEI->m_colourRemapBitDepth); … … 1902 1903 } 1903 1904 1904 static void applyColourRemapping(TComPicYuv& pic, const SEIColourRemappingInfo* pCriSEI, UInt layerId )1905 static Void applyColourRemapping(TComPicYuv& pic, const SEIColourRemappingInfo* pCriSEI, const BitDepths& bitDpeths, UInt layerId ) 1905 1906 { 1906 1907 if( !storeCriSEI.size() ) … … 1940 1941 YUVOut[2] = picColourRemapped.getAddr(COMPONENT_Cr); 1941 1942 1942 #if SVC_EXTENSION1943 Int bitDepthY = g_bitDepthLayer[CHANNEL_TYPE_LUMA][layerId];1944 Int bitDepthC = g_bitDepthLayer[CHANNEL_TYPE_CHROMA][layerId];1945 1946 #else1947 Int bitDepthY = g_bitDepth[CHANNEL_TYPE_LUMA];1948 Int bitDepthC = g_bitDepth[CHANNEL_TYPE_CHROMA];1949 #endif1950 1951 1943 std::vector<Int> preLut[3]; 1952 1944 std::vector<Int> postLut[3]; 1953 xInitColourRemappingLut( bitD epthY, bitDepthC, preLut, postLut, &storeCriSEI[layerId] );1945 xInitColourRemappingLut( bitDpeths, preLut, postLut, &storeCriSEI[layerId] ); 1954 1946 1955 1947 Int roundingOffset = (storeCriSEI[layerId].m_log2MatrixDenom==0) ? 0 : (1 << (storeCriSEI[layerId].m_log2MatrixDenom - 1)); -
branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.h
r1259 r1287 96 96 Void xInitDecLib (); ///< initialize decoder class 97 97 98 #if Q0074_COLOUR_REMAPPING_SEI 99 Void xInitColourRemappingLut( const BitDepths &bitDepths, std::vector<Int>(&preLut)[3], std::vector<Int>(&postLut)[3], const SEIColourRemappingInfo* const pCriSEI ); 100 #endif 98 101 #if SVC_EXTENSION 99 102 Void xWriteOutput ( TComList<TComPic*>* pcListPic, UInt layerId, UInt tId ); ///< write YUV to file -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r1286 r1287 4308 4308 g_uiMaxCUDepth = m_uiMaxCUDepth; 4309 4309 #endif 4310 4311 // set internal bit-depth and constants4312 for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)4313 {4314 #if O0043_BEST_EFFORT_DECODING4315 g_bitDepthInStream[channelType] = g_bitDepth[channelType] = m_internalBitDepth[channelType];4316 #else4317 g_bitDepth [channelType] = m_internalBitDepth[channelType];4318 #endif4319 }4320 4310 } 4321 4311 #endif … … 4489 4479 printf("TOOL CFG: "); 4490 4480 #if !SVC_EXTENSION 4491 printf("IBD:%d ", (( g_bitDepth[CHANNEL_TYPE_LUMA] > m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA]) || (g_bitDepth[CHANNEL_TYPE_CHROMA] > m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA])));4481 printf("IBD:%d ", ((m_internalBitDepth[CHANNEL_TYPE_LUMA] > m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA]) || (m_internalBitDepth[CHANNEL_TYPE_CHROMA] > m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA]))); 4492 4482 #endif 4493 4483 printf("HAD:%d ", m_bUseHADME ); -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r1285 r1287 217 217 { 218 218 //1 219 g_bitDepth[CHANNEL_TYPE_LUMA] = m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA];220 g_bitDepth[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA];221 222 // Set this to be used in Upsampling filter in function "TComUpsampleFilter::upsampleBasePic"223 g_bitDepthLayer[CHANNEL_TYPE_LUMA][m_acLayerCfg[layer].m_layerId] = g_bitDepth[CHANNEL_TYPE_LUMA];224 g_bitDepthLayer[CHANNEL_TYPE_CHROMA][m_acLayerCfg[layer].m_layerId] = g_bitDepth[CHANNEL_TYPE_CHROMA];225 226 219 m_acTEncTop[layer].setInterLayerWeightedPredFlag ( m_useInterLayerWeightedPred ); 227 220 … … 475 468 for( UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++ ) 476 469 { 477 m_acTEncTop[layer].setPCMBitDepth ((ChannelType)channelType, m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_MSBExtendedBitDepth[channelType] : m_acLayerCfg[layer].m_internalBitDepth[channelType]); 470 m_acTEncTop[layer].setBitDepth ((ChannelType)channelType, m_acLayerCfg[layer].m_internalBitDepth[channelType]); 471 m_acTEncTop[layer].setPCMBitDepth ((ChannelType)channelType, m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_MSBExtendedBitDepth[channelType] : m_acLayerCfg[layer].m_internalBitDepth[channelType]); 478 472 } 479 473 m_acTEncTop[layer].setPCMLog2MaxSize ( m_pcmLog2MaxSize); … … 904 898 for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++) 905 899 { 906 //#if O0043_BEST_EFFORT_DECODING 907 //g_bitDepthInStream[channelType] = g_bitDepth[channelType] = m_internalBitDepth[channelType]; 908 //#else 909 //g_bitDepth [channelType] = m_internalBitDepth[channelType]; 910 //#endif 900 m_cTEncTop.setBitDepth((ChannelType)channelType, m_internalBitDepth[channelType]); 911 901 m_cTEncTop.setPCMBitDepth((ChannelType)channelType, m_bPCMInputBitDepthFlag ? m_MSBExtendedBitDepth[channelType] : m_internalBitDepth[channelType]); 912 902 } … … 1094 1084 { 1095 1085 //2 1096 for( UInt channelTypeIndex = 0; channelTypeIndex < MAX_NUM_CHANNEL_TYPE; channelTypeIndex++)1097 {1098 g_bitDepth[channelTypeIndex] = m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex];1099 }1100 1101 1086 #if LAYER_CTB 1102 1087 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; … … 1193 1178 { 1194 1179 //3 1195 for (UInt channelTypeIndex = 0; channelTypeIndex < MAX_NUM_CHANNEL_TYPE; channelTypeIndex++)1196 {1197 g_bitDepth[channelTypeIndex] = m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex];1198 }1199 1180 #if LAYER_CTB 1200 1181 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; … … 1233 1214 Int layerIdx = vps->getLayerIdxInVps(m_layerSetLayerIdList[setId][i]); 1234 1215 //4 1235 g_bitDepth[CHANNEL_TYPE_LUMA] = m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_LUMA];1236 g_bitDepth[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_CHROMA];1237 1238 1216 vps->setLayerIdIncludedFlag(true, setId, layerId); 1239 1217 } … … 1250 1228 //4 1251 1229 UInt layerId = vps->getLayerIdInNuh(layerIdx); 1252 g_bitDepth[CHANNEL_TYPE_LUMA] = m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_LUMA];1253 g_bitDepth[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_CHROMA];1254 1230 1255 1231 if (layerId <= setId) … … 1702 1678 { 1703 1679 //5 1704 g_bitDepth[CHANNEL_TYPE_LUMA] = m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA];1705 g_bitDepth[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA];1706 1707 1680 // allocate original YUV buffer 1708 1681 pcPicYuvOrg[layer] = new TComPicYuv; … … 1739 1712 { 1740 1713 //6 1741 for (UInt channelTypeIndex = 0; channelTypeIndex < MAX_NUM_CHANNEL_TYPE; channelTypeIndex++)1742 {1743 g_bitDepth[channelTypeIndex] = m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex];1744 }1745 1714 #if LAYER_CTB 1746 1715 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; … … 1759 1728 if( m_acLayerCfg[layer].getChromaFormatIDC() == CHROMA_400 || (m_apcTEncTop[0]->getVPS()->getScalabilityMask(AUX_ID) && (m_acLayerCfg[layer].getAuxId() == AUX_ALPHA || m_acLayerCfg[layer].getAuxId() == AUX_DEPTH)) ) 1760 1729 { 1761 pcPicYuvOrg[layer]->convertToMonochrome( );1730 pcPicYuvOrg[layer]->convertToMonochrome(m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]); 1762 1731 } 1763 1732 #endif … … 1823 1792 { 1824 1793 //7 1825 for( UInt channelTypeIndex = 0; channelTypeIndex < MAX_NUM_CHANNEL_TYPE; channelTypeIndex++ )1826 {1827 g_bitDepth[channelTypeIndex] = m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex];1828 }1829 1794 #if LAYER_CTB 1830 1795 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; … … 1895 1860 { 1896 1861 //8 1897 for( UInt channelTypeIndex = 0; channelTypeIndex < MAX_NUM_CHANNEL_TYPE; channelTypeIndex++ )1898 {1899 g_bitDepth[channelTypeIndex] = m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex];1900 }1901 1902 1862 // write bistream to file if necessary 1903 1863 iNumEncoded = m_acTEncTop[layer].getNumPicRcvd(); … … 1983 1943 for(layer = 0; layer < m_numLayers; layer++) 1984 1944 { 1985 m_gcAnalyzeAll[layer].printOut('a', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, layer); 1945 const BitDepths bitDepths(m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]); 1946 1947 m_gcAnalyzeAll[layer].printOut('a', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer); 1986 1948 } 1987 1949 … … 1989 1951 for(layer = 0; layer < m_numLayers; layer++) 1990 1952 { 1991 m_gcAnalyzeI[layer].printOut('i', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, layer); 1953 const BitDepths bitDepths(m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]); 1954 1955 m_gcAnalyzeI[layer].printOut('i', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer); 1992 1956 } 1993 1957 … … 1995 1959 for(layer = 0; layer < m_numLayers; layer++) 1996 1960 { 1997 m_gcAnalyzeP[layer].printOut('p', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, layer); 1961 const BitDepths bitDepths(m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]); 1962 1963 m_gcAnalyzeP[layer].printOut('p', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer); 1998 1964 } 1999 1965 … … 2001 1967 for(layer = 0; layer < m_numLayers; layer++) 2002 1968 { 2003 m_gcAnalyzeB[layer].printOut('b', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, layer); 1969 const BitDepths bitDepths(m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]); 1970 1971 m_gcAnalyzeB[layer].printOut('b', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer); 2004 1972 } 2005 1973 … … 2008 1976 for(layer = 0; layer < m_numLayers; layer++) 2009 1977 { 1978 const BitDepths bitDepths(m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]); 1979 2010 1980 //-- interlaced summary 2011 1981 m_gcAnalyzeAll_in.setFrmRate( m_acLayerCfg[layer].getFrameRate()); … … 2014 1984 2015 1985 printf( "\n\nSUMMARY INTERLACED ---------------------------------------------\n" ); 2016 m_gcAnalyzeAll_in.printOut('a', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, layer);1986 m_gcAnalyzeAll_in.printOut('a', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer); 2017 1987 2018 1988 #if _SUMMARY_OUT_
Note: See TracChangeset for help on using the changeset viewer.