Changeset 815 in SHVCSoftware for trunk/source/Lib/TLibCommon/TComPicYuv.cpp


Ignore:
Timestamp:
30 Jun 2014, 06:13:06 (10 years ago)
Author:
seregin
Message:

merge with SHM-6-dev branch

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/source

  • trunk/source/Lib/TLibCommon/TComPicYuv.cpp

    r713 r815  
    6767{
    6868}
     69
     70#if SVC_EXTENSION
    6971#if AUXILIARY_PICTURES
    70 #if SVC_UPSAMPLING
    7172Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps )
    7273#else
    73 Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth )
    74 #endif
    75 #else
    76 #if SVC_UPSAMPLING
    7774Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps )
     75#endif
    7876#else
    7977Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth )
    8078#endif
    81 #endif
    8279{
    8380  m_iPicWidth       = iPicWidth;
    8481  m_iPicHeight      = iPicHeight;
    8582 
    86 #if SVC_UPSAMPLING
     83#if SVC_EXTENSION
    8784  if(pcSps != NULL)
    8885  {
     
    369366}
    370367
     368#if SVC_EXTENSION
     369Void TComPicYuv::dump( Char* pFileName, Bool bAdd, Int bitDepth )
     370{
     371  FILE* pFile;
     372  if (!bAdd)
     373  {
     374    pFile = fopen (pFileName, "wb");
     375  }
     376  else
     377  {
     378    pFile = fopen (pFileName, "ab");
     379  }
     380
     381  if( bitDepth == 8 )
     382  {
     383    dump( pFileName, bAdd );
     384    return;
     385  }
     386 
     387  Int   x, y;
     388  UChar uc;
     389 
     390  Pel*  piY   = getLumaAddr();
     391  Pel*  piCb  = getCbAddr();
     392  Pel*  piCr  = getCrAddr();
     393 
     394  for ( y = 0; y < m_iPicHeight; y++ )
     395  {
     396    for ( x = 0; x < m_iPicWidth; x++ )
     397    {
     398      uc = piY[x] & 0xff;     
     399      fwrite( &uc, sizeof(UChar), 1, pFile );
     400      uc = (piY[x] >> 8) & 0xff;     
     401      fwrite( &uc, sizeof(UChar), 1, pFile );
     402    }
     403    piY += getStride();
     404  }
     405 
     406  for ( y = 0; y < m_iPicHeight >> 1; y++ )
     407  {
     408    for ( x = 0; x < m_iPicWidth >> 1; x++ )
     409    {
     410      uc = piCb[x] & 0xff;
     411      fwrite( &uc, sizeof(UChar), 1, pFile );
     412      uc = (piCb[x] >> 8) & 0xff;
     413      fwrite( &uc, sizeof(UChar), 1, pFile );
     414    }
     415    piCb += getCStride();
     416  }
     417 
     418  for ( y = 0; y < m_iPicHeight >> 1; y++ )
     419  {
     420    for ( x = 0; x < m_iPicWidth >> 1; x++ )
     421    {
     422      uc = piCr[x] & 0xff;
     423      fwrite( &uc, sizeof(UChar), 1, pFile );
     424      uc = (piCr[x] >> 8) & 0xff;
     425      fwrite( &uc, sizeof(UChar), 1, pFile );
     426    }
     427    piCr += getCStride();
     428  }
     429 
     430  fclose(pFile);
     431}
     432
     433#endif
    371434
    372435//! \}
Note: See TracChangeset for help on using the changeset viewer.