Ticket #1121: num_reorder_pics.patch

File num_reorder_pics.patch, 8.6 KB (added by bheng, 8 years ago)
  • App/TAppDecoder/TAppDecTop.cpp

     
    193193      // write reconstruction to file
    194194      if(bNewPicture)
    195195      {
    196         xWriteOutput( pcListPic, nalu.m_temporalId );
     196        xWriteOutput( pcListPic );
    197197      }
    198198    }
    199199  }
     
    237237/** \param pcListPic list of pictures to be written to file
    238238    \todo            DYN_REF_FREE should be revised
    239239 */
    240 Void TAppDecTop::xWriteOutput( TComList<TComPic*>* pcListPic, UInt tId )
     240Void TAppDecTop::xWriteOutput( TComList<TComPic*>* pcListPic )
    241241{
    242242  TComList<TComPic*>::iterator iterPic   = pcListPic->begin();
    243243  Int not_displayed = 0;
     
    257257  {
    258258    TComPic* pcPic = *(iterPic);
    259259   
    260     if ( pcPic->getOutputMark() && (not_displayed >  pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_iPOCLastDisplay))
     260    if ( pcPic->getOutputMark() && (not_displayed >  pcPic->getNumReorderPics( ) && pcPic->getPOC() > m_iPOCLastDisplay))
    261261    {
    262262      // write to file
    263263       not_displayed--;
  • App/TAppDecoder/TAppDecTop.h

     
    8080  Void  xDestroyDecLib    (); ///< destroy internal classes
    8181  Void  xInitDecLib       (); ///< initialize decoder class
    8282 
    83   Void  xWriteOutput      ( TComList<TComPic*>* pcListPic , UInt tId); ///< write YUV to file
     83  Void  xWriteOutput      ( TComList<TComPic*>* pcListPic ); ///< write YUV to file
    8484  Void  xFlushOutput      ( TComList<TComPic*>* pcListPic ); ///< flush all remaining decoded pictures to file
    8585  Bool  isNaluWithinTargetDecLayerIdSet ( InputNALUnit* nalu ); ///< check whether given Nalu is within targetDecLayerIdSet
    8686};
  • Lib/TLibCommon/TComPic.cpp

     
    7373}
    7474
    7575Void TComPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow,
    76                       Int *numReorderPics, Bool bIsVirtual)
     76                      Int numReorderPics, Bool bIsVirtual)
    7777
    7878{
    7979  m_apcPicSym     = new TComPicSym;  m_apcPicSym   ->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth );
     
    9696  /* store display window parameters with picture */
    9797  m_defaultDisplayWindow = defaultDisplayWindow;
    9898
    99   /* store number of reorder pics with picture */
    100   memcpy(m_numReorderPics, numReorderPics, MAX_TLAYER*sizeof(Int));
     99  /* store maximum number of reorder pics for highest temporal ID with picture */
     100  m_numReorderPics = numReorderPics;
    101101
    102102  return;
    103103}
  • Lib/TLibCommon/TComPic.h

     
    7777  TComPicYuv*           m_pNDBFilterYuvTmp;    //!< temporary picture buffer when non-cross slice/tile boundary in-loop filtering is enabled
    7878  Bool                  m_bCheckLTMSB;
    7979 
    80   Int                   m_numReorderPics[MAX_TLAYER];
     80  Int                   m_numReorderPics;      // maximum number of reorder pictures for highest temporal ID
    8181  Window                m_conformanceWindow;
    8282  Window                m_defaultDisplayWindow;
    8383
     
    9090  virtual ~TComPic();
    9191 
    9292  Void          create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow,
    93                         Int *numReorderPics, Bool bIsVirtual = false );
     93                        Int numReorderPics, Bool bIsVirtual = false );
    9494                       
    9595  virtual Void  destroy();
    9696 
     
    137137  Void          setOutputMark (Bool b) { m_bNeededForOutput = b;     }
    138138  Bool          getOutputMark ()       { return m_bNeededForOutput;  }
    139139 
    140   Void          setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i;    }
    141   Int           getNumReorderPics(UInt tlayer)        { return m_numReorderPics[tlayer]; }
     140  Void          setNumReorderPics(Int i) { m_numReorderPics = i;    }
     141  Int           getNumReorderPics()      { return m_numReorderPics; }
    142142
    143143  Void          compressMotion();
    144144  UInt          getCurrSliceIdx()            { return m_uiCurrSliceIdx;                }
  • Lib/TLibDecoder/TDecTop.cpp

     
    130130    rpcPic = new TComPic();
    131131   
    132132    rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
    133                      conformanceWindow, defaultDisplayWindow, numReorderPics, true);
     133                     conformanceWindow, defaultDisplayWindow, pcSlice->getSPS()->getNumReorderPics(pcSlice->getSPS()->getMaxTLayers()-1), true);
    134134    rpcPic->getPicSym()->allocSaoParam(&m_cSAO);
    135135    m_cListPic.pushBack( rpcPic );
    136136   
     
    168168  }
    169169  rpcPic->destroy();
    170170  rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
    171                    conformanceWindow, defaultDisplayWindow, numReorderPics, true);
     171                   conformanceWindow, defaultDisplayWindow, pcSlice->getSPS()->getNumReorderPics(pcSlice->getSPS()->getMaxTLayers()-1), true);
    172172  rpcPic->getPicSym()->allocSaoParam(&m_cSAO);
    173173}
    174174
  • Lib/TLibEncoder/TEncPic.cpp

     
    122122 * \param uiMaxHeight Maximum CU height
    123123 * \param uiMaxDepth Maximum CU depth
    124124 * \param uiMaxAQDepth Maximum depth of unit block for assigning QP adaptive to local image characteristics
     125 * \param conformanceWindow Conformance window parameters
     126 * \param defaultDisplayWindow Display window parameters
     127 * \param numReorderPics Maximum number of reorder pictures for highest temporal ID
    125128 * \param bIsVirtual
    126129 * \return Void
    127130 */
    128131Void TEncPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 
    129                       Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual )
     132                      Window &conformanceWindow, Window &defaultDisplayWindow, Int numReorderPics, Bool bIsVirtual )
    130133{
    131134  TComPic::create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, 
    132135                   conformanceWindow, defaultDisplayWindow, numReorderPics, bIsVirtual );
  • Lib/TLibEncoder/TEncPic.h

     
    103103  virtual ~TEncPic();
    104104
    105105  Void          create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth,   
    106                         Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual = false );
     106                        Window &conformanceWindow, Window &defaultDisplayWindow, Int numReorderPics, Bool bIsVirtual = false );
    107107  virtual Void  destroy();
    108108
    109109  TEncPicQPAdaptationLayer* getAQLayer( UInt uiDepth )  { return &m_acAQLayer[uiDepth]; }
  • Lib/TLibEncoder/TEncTop.cpp

     
    419419    {
    420420      TEncPic* pcEPic = new TEncPic;
    421421      pcEPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 ,
    422                       m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics);
     422                      m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics[m_maxTempLayer-1]);
    423423      rpcPic = pcEPic;
    424424    }
    425425    else
     
    427427      rpcPic = new TComPic;
    428428
    429429      rpcPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
    430                       m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics);
     430                      m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics[m_maxTempLayer-1]);
    431431    }
    432432    if (getUseSAO())
    433433    {