Changeset 1287 in SHVCSoftware for branches/SHM-dev/source/App/TAppDecoder
- Timestamp:
- 17 Jul 2015, 05:43:37 (10 years ago)
- Location:
- branches/SHM-dev/source/App/TAppDecoder
- Files:
-
- 2 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
Note: See TracChangeset for help on using the changeset viewer.