Changeset 48 in 3DVCSoftware for branches/0.3-poznan-univ/source/App


Ignore:
Timestamp:
30 Mar 2012, 18:57:41 (13 years ago)
Author:
poznan-univ
Message:

some bug fix on high level syntax
fixed some compiler warning issues under windows and linux

Location:
branches/0.3-poznan-univ/source/App
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/0.3-poznan-univ/source/App/TAppDecoder/TAppDecTop.cpp

    r41 r48  
    739739Void TAppDecTop::storeSynthPicsInBuffer(Int iCoddedViewIdx,Int iCoddedViewOrderIdx, Int iCurPoc, Bool bDepth)
    740740{
    741   Int  iLeftViewIdx  = -1;
    742   Int  iRightViewIdx = -1;
    743741  Int  iNearestViewIdx = -1;
    744742  Bool bRenderFromLeft;
     
    830828Void TAppDecTop::storeDepthSynthPicsInBuffer(Int iCoddedViewIdx,Int iCoddedViewOrderIdx, Int iCurPoc)
    831829{
    832   Int  iLeftViewIdx  = -1;
    833   Int  iRightViewIdx = -1;
    834830  Int  iNearestViewIdx = -1;
    835831  Bool bRenderFromLeft;
  • branches/0.3-poznan-univ/source/App/TAppEncoder/TAppEncCfg.cpp

    r41 r48  
    523523      size = m_iSourceWidth*m_iSourceHeight;
    524524      depth_buf = (unsigned char *)malloc(size);
    525       fread(depth_buf, 1, size, base_depth_file);
     525      size_t read = fread(depth_buf, 1, size, base_depth_file);
    526526      fclose(base_depth_file);
    527       memset(histogram, 0, sizeof(histogram));
    528       for (i=0; i<size;++i) histogram[depth_buf[i]]++;
    529       weighted_avg = 0;
    530       for (i=0; i<256; ++i) weighted_avg += i*histogram[i];
    531       weighted_avg /= size;
    532 
    533       if (weighted_avg<m_iNonlinearDepthThreshold)
     527      if(read)
    534528      {
    535         m_bUseNonlinearDepth = 0;
    536         printf ("\nWeighted average of depth histogram:%f < %d, turning NonlinearDepthRepresentation OFF\n", weighted_avg, m_iNonlinearDepthThreshold);
     529        memset(histogram, 0, sizeof(histogram));
     530        for (i=0; i<size;++i) histogram[depth_buf[i]]++;
     531        weighted_avg = 0;
     532        for (i=0; i<256; ++i) weighted_avg += i*histogram[i];
     533        weighted_avg /= size;
     534
     535        if (weighted_avg<m_iNonlinearDepthThreshold)
     536        {
     537          m_bUseNonlinearDepth = 0;
     538          printf ("\nWeighted average of depth histogram:%f < %d, turning NonlinearDepthRepresentation OFF\n", weighted_avg, m_iNonlinearDepthThreshold);
     539        }
    537540      }
    538541    }
     
    542545  if(m_bUseNonlinearDepth)
    543546  {
     547     if((Int)m_aiNonlinearDepthModel.size()== 0)
     548     {
     549       m_aiNonlinearDepthModel.push_back(10);
     550       m_aiNonlinearDepthModel.push_back(19);
     551       m_aiNonlinearDepthModel.push_back(24);
     552       m_aiNonlinearDepthModel.push_back(27);
     553       m_aiNonlinearDepthModel.push_back(26);
     554       m_aiNonlinearDepthModel.push_back(22);
     555       m_aiNonlinearDepthModel.push_back(13);
     556     }
     557    //10,19,24,27,26,22,13
    544558    m_cNonlinearDepthModel.m_iNum = (Int)m_aiNonlinearDepthModel.size();
     559   
    545560    m_cNonlinearDepthModel.m_aiPoints[0]=0;
     561
    546562    for (int i=0; i<m_cNonlinearDepthModel.m_iNum; ++i)
    547563      m_cNonlinearDepthModel.m_aiPoints[i+1] = m_aiNonlinearDepthModel[i];
  • branches/0.3-poznan-univ/source/App/TAppEncoder/TAppEncTop.cpp

    r41 r48  
    150150#endif
    151151
     152#if BITSTREAM_EXTRACTION
     153    m_acTEncTopList[iViewIdx]->setLayerId                      ( ( (UInt)iViewIdx ) << 1 );
     154#endif
    152155    m_acTEncTopList[iViewIdx]->setViewId                       ( (UInt)iViewIdx );
    153156    m_acTEncTopList[iViewIdx]->setViewOrderIdx                 ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] );
     
    359362#endif
    360363
     364#if BITSTREAM_EXTRACTION
     365      m_acTEncDepthTopList[iViewIdx]->setLayerId                      ( ( ( (UInt)iViewIdx ) << 1 ) + 1 );
     366#endif
    361367      m_acTEncDepthTopList[iViewIdx]->setViewId                       ( (UInt)iViewIdx );
    362368      m_acTEncDepthTopList[iViewIdx]->setViewOrderIdx                 ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] );
    363369      m_acTEncDepthTopList[iViewIdx]->setIsDepth                      ( true );
     370#if FLEX_CODING_ORDER
     371      m_acTEncDepthTopList[iViewIdx]->setCamParPrecision              ( m_cCameraData.getCamParsCodedPrecision  () );
     372      m_acTEncDepthTopList[iViewIdx]->setCamParInSliceHeader          ( m_cCameraData.getVaryingCameraParameters() );
     373      m_acTEncDepthTopList[iViewIdx]->setCodedScale                   ( m_cCameraData.getCodedScale             () );
     374      m_acTEncDepthTopList[iViewIdx]->setCodedOffset                  ( m_cCameraData.getCodedOffset            () );
     375#else
    364376      m_acTEncDepthTopList[iViewIdx]->setCamParPrecision              ( 0 );
    365377      m_acTEncDepthTopList[iViewIdx]->setCamParInSliceHeader          ( false );
    366378      m_acTEncDepthTopList[iViewIdx]->setCodedScale                   ( 0 );
    367379      m_acTEncDepthTopList[iViewIdx]->setCodedOffset                  ( 0 );
     380#endif
    368381#if DEPTH_MAP_GENERATION
    369382      m_acTEncDepthTopList[iViewIdx]->setPredDepthMapGeneration       ( 0 );
     
    794807          iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0');
    795808          bThisViewContinueReadingPics = bContinueReadingPics[iViewIdx];
     809#if POZNAN_SYNTH
     810          if( m_uiUseCUSkip )
     811          {
     812            xStoreSynthPicsInBuffer(iViewIdx,false);
     813          }
     814#endif
    796815#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
    797816          // If no depth picture reconstruction for current view and current POC is available sythesize one
    798           Int   iCurrPoc         = m_acTEncTopList[ 0 ]->getNextFrameId();
     817          //Int   iCurrPoc2         = m_acTEncTopList[ 0 ]->getNextFrameId();
    799818          Bool  bCurrPicDepthRec = getPicFromView( iViewIdx, iCurrPoc, true ) != NULL && getPicFromView( iViewIdx, iCurrPoc, true )->getReconMark();
    800819          if(m_bUseTexDqpAccordingToDepth && !bCurrPicDepthRec)
     
    825844            iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0');
    826845            bThisViewContinueReadingDepthPics = bContinueReadingDepthPics[iViewIdx];
     846#if POZNAN_SYNTH
     847            if( m_uiUseCUSkip )
     848            {
     849              xStoreSynthPicsInBuffer(iViewIdx,true);
     850            }
     851#endif
    827852            m_acTEncDepthTopList[iViewIdx]->encode( bDepthEos[iViewIdx], m_cListPicYuvDepthRecMap[iViewIdx], pcBitstream, bThisViewContinueReadingDepthPics );
    828853            bContinueReadingDepthPics[iViewIdx]=bThisViewContinueReadingDepthPics;
     
    858883#if FLEX_CODING_ORDER
    859884      // If no depth picture reconstruction for current view and current POC is available sythesize one
    860       Int   iCurrPoc         = m_acTEncTopList[ 0 ]->getNextFrameId();
     885      //Int   iCurrPoc         = m_acTEncTopList[ 0 ]->getNextFrameId();
    861886      Bool  bCurrPicDepthRec = getPicFromView( iViewIdx, iCurrPoc, true ) != NULL && getPicFromView( iViewIdx, iCurrPoc, true )->getReconMark();
    862887      if(m_bUseTexDqpAccordingToDepth && !bCurrPicDepthRec)
     
    13901415  }
    13911416 
    1392   Int iNumberOfReferenceViews = 0;
    13931417  Int  iNearestViewIdx = -1;
    13941418  Bool bRenderFromLeft;
     
    14771501Void TAppEncTop::xStoreDepthSynthPicsInBuffer(Int iCoddedViewIdx)
    14781502{
    1479   Int  iLeftViewIdx  = -1;
    1480   Int  iRightViewIdx = -1;
    14811503  Int  iNearestViewIdx = -1;
    14821504  Bool bRenderFromLeft;
  • branches/0.3-poznan-univ/source/App/TAppRenderer/TAppRendererTop.cpp

    r45 r48  
    308308            else
    309309            {
    310               Int iDistLeft  = abs( m_cCameraData.getBaseId2SortedId()[0] - m_cCameraData.getBaseId2SortedId() [iLeftBaseViewIdx ]  );
    311               Int iDistRight = abs( m_cCameraData.getBaseId2SortedId()[0] - m_cCameraData.getBaseId2SortedId() [iRightBaseViewIdx]  );
     310              //Int iDistLeft  = abs( m_cCameraData.getBaseId2SortedId()[0] - m_cCameraData.getBaseId2SortedId() [iLeftBaseViewIdx ]  );
     311              //Int iDistRight = abs( m_cCameraData.getBaseId2SortedId()[0] - m_cCameraData.getBaseId2SortedId() [iRightBaseViewIdx]  );
    312312
    313313              Int iFillViewIdx = (0!=iLeftBaseViewIdx)? iLeftBaseViewIdx: iRightBaseViewIdx;
Note: See TracChangeset for help on using the changeset viewer.