Changeset 1287 in SHVCSoftware for branches/SHM-dev/source/App/TAppDecoder


Ignore:
Timestamp:
17 Jul 2015, 05:43:37 (10 years ago)
Author:
seregin
Message:

port rev 4322 (g_bitDepth)

Location:
branches/SHM-dev/source/App/TAppDecoder
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp

    r1273 r1287  
    5757
    5858#if Q0074_COLOUR_REMAPPING_SEI
    59 static Void applyColourRemapping(TComPicYuv& pic, const SEIColourRemappingInfo* colourRemappingInfoSEI, UInt layerId=0 );
     59static Void applyColourRemapping(TComPicYuv& pic, const SEIColourRemappingInfo* colourRemappingInfoSEI, const BitDepths& bitDpeths, UInt layerId=0 );
    6060static std::vector<SEIColourRemappingInfo> storeCriSEI; //Persistent Colour Remapping Information SEI
    6161static SEIColourRemappingInfo *seiColourRemappingInfoPrevious=NULL ;
     
    290290#endif
    291291    {
    292       // Set bitdepth for each layer when doing DBF
    293       g_bitDepth[CHANNEL_TYPE_LUMA]   = g_bitDepthLayer[CHANNEL_TYPE_LUMA][curLayerId];
    294       g_bitDepth[CHANNEL_TYPE_CHROMA] = g_bitDepthLayer[CHANNEL_TYPE_CHROMA][curLayerId];
    295 
    296292      if (!loopFiltered[curLayerId] || bitstreamFile)
    297293      {
     
    322318      if ( m_pchReconFile[curLayerId] && !openedReconFile[curLayerId] )
    323319      {
     320        const BitDepths &bitDepths=pcListPic->front()->getSlice(0)->getBitDepths(); // use bit depths of first reconstructed picture.
    324321        for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
    325322        {
    326323          if (m_outputBitDepth[channelType] == 0)
    327324          {
    328             m_outputBitDepth[channelType] = g_bitDepth[channelType];
     325            m_outputBitDepth[channelType] = bitDepths.recon[channelType];
    329326          }
    330327        }
    331         m_acTVideoIOYuvReconFile[curLayerId].open( m_pchReconFile[curLayerId], true, m_outputBitDepth, m_outputBitDepth, g_bitDepth ); // write mode
     328        m_acTVideoIOYuvReconFile[curLayerId].open( m_pchReconFile[curLayerId], true, m_outputBitDepth, m_outputBitDepth, bitDepths.recon ); // write mode
    332329
    333330        openedReconFile[curLayerId] = true;
     
    541538      if ( m_pchReconFile && !openedReconFile )
    542539      {
     540        const BitDepths &bitDepths=pcListPic->front()->getPicSym()->getSPS().getBitDepths(); // use bit depths of first reconstructed picture.
    543541        for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
    544542        {
    545543          if (m_outputBitDepth[channelType] == 0)
    546544          {
    547             m_outputBitDepth[channelType] = g_bitDepth[channelType];
     545            m_outputBitDepth[channelType] = bitDepths.recon[channelType];
    548546          }
    549547        }
    550548
    551         m_cTVideoIOYuvReconFile.open( m_pchReconFile, true, m_outputBitDepth, m_outputBitDepth, g_bitDepth ); // write mode
     549        m_cTVideoIOYuvReconFile.open( m_pchReconFile, true, m_outputBitDepth, m_outputBitDepth, bitDepths.recon ); // write mode
    552550        openedReconFile = true;
    553551      }
     
    12981296      {
    12991297        //printf ("\n\nColour Remapping is applied to POC : %d and LayerId : %d ",pic->getPOC(), pic->getLayerId());
    1300         applyColourRemapping(*pic->getPicYuvRec(), seiColourRemappingInfo
    13011298#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
    13051303      }
    13061304      else  // using the last CRI SEI received
     
    13081306        const SEIColourRemappingInfo *seiColourRemappingInfoCopy;
    13091307        seiColourRemappingInfoCopy = seiColourRemappingInfoPrevious;
    1310         applyColourRemapping(*pic->getPicYuvRec(), seiColourRemappingInfoCopy
    13111308#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
    13151313      }
    13161314
     
    15451543
    15461544        TComPictureHash recon_digest;
    1547         Int numChar = calcMD5(*pic->getPicYuvRec(), recon_digest);
     1545        Int numChar = calcMD5(*pic->getPicYuvRec(), recon_digest, pic->getSlice(0)->getBitDepths());
    15481546        fprintf(fptr, "%8d%9d    MD5:%s\n", pic->getLayerId(), pic->getSlice(0)->getPOC(), hashToString(recon_digest, numChar).c_str());
    15491547        fclose(fptr);
     
    15701568      if( this->getDecodedYuvLayerRefresh(layerId) )
    15711569      {
    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 
    15751570        char tempFileName[256];
    15761571        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
    15781579        this->setDecodedYuvLayerRefresh( layerId, false );
    15791580      }
     
    18451846
    18461847#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 )
     1848Void xInitColourRemappingLut( const BitDepths &bitDepths, std::vector<Int>(&preLut)[3], std::vector<Int>(&postLut)[3], const SEIColourRemappingInfo* const pCriSEI )
    18481849{
    18491850  for ( Int c=0 ; c<3 ; c++ )
    18501851  { 
    1851     Int bitDepth = c ? bitDepthC : bitDepthY ;
     1852    Int bitDepth = bitDepths.recon[toChannelType(ComponentID(c))];
    18521853    preLut[c].resize(1 << bitDepth);
    18531854    postLut[c].resize(1 << pCriSEI->m_colourRemapBitDepth);
     
    19021903}
    19031904
    1904 static void applyColourRemapping(TComPicYuv& pic, const SEIColourRemappingInfo* pCriSEI, UInt layerId )
     1905static Void applyColourRemapping(TComPicYuv& pic, const SEIColourRemappingInfo* pCriSEI, const BitDepths& bitDpeths, UInt layerId )
    19051906
    19061907  if( !storeCriSEI.size() )
     
    19401941    YUVOut[2] = picColourRemapped.getAddr(COMPONENT_Cr);
    19411942
    1942 #if SVC_EXTENSION
    1943     Int bitDepthY = g_bitDepthLayer[CHANNEL_TYPE_LUMA][layerId];
    1944     Int bitDepthC = g_bitDepthLayer[CHANNEL_TYPE_CHROMA][layerId];
    1945 
    1946 #else
    1947     Int bitDepthY = g_bitDepth[CHANNEL_TYPE_LUMA];
    1948     Int bitDepthC = g_bitDepth[CHANNEL_TYPE_CHROMA];
    1949 #endif
    1950 
    19511943    std::vector<Int> preLut[3];
    19521944    std::vector<Int> postLut[3];
    1953     xInitColourRemappingLut( bitDepthY, bitDepthC, preLut, postLut, &storeCriSEI[layerId] );
     1945    xInitColourRemappingLut( bitDpeths, preLut, postLut, &storeCriSEI[layerId] );
    19541946   
    19551947    Int roundingOffset = (storeCriSEI[layerId].m_log2MatrixDenom==0) ? 0 : (1 << (storeCriSEI[layerId].m_log2MatrixDenom - 1));
  • branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.h

    r1259 r1287  
    9696  Void  xInitDecLib       (); ///< initialize decoder class
    9797 
     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
    98101#if SVC_EXTENSION
    99102  Void  xWriteOutput      ( TComList<TComPic*>* pcListPic, UInt layerId, UInt tId ); ///< write YUV to file
Note: See TracChangeset for help on using the changeset viewer.