Ignore:
Timestamp:
12 Nov 2014, 08:09:17 (10 years ago)
Author:
seregin
Message:

initial porting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-upgrade/source/Lib/TLibCommon/TComPrediction.h

    r849 r916  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license. 
     4 * granted under this license.
    55 *
    66 * Copyright (c) 2010-2014, ITU/ISO/IEC
     
    4848#include "TComWeightPrediction.h"
    4949
     50class TComTU; // forward declaration
     51
    5052#if SVC_EXTENSION
    5153#include "TComUpsampleFilter.h"
     
    5961
    6062/// prediction class
     63typedef enum PRED_BUF_E
     64{
     65  PRED_BUF_UNFILTERED=0,
     66  PRED_BUF_FILTERED=1,
     67  NUM_PRED_BUF=2
     68} PRED_BUF;
     69
     70static const UInt MAX_INTRA_FILTER_DEPTHS=5;
     71
    6172class TComPrediction : public TComWeightPrediction
    6273{
     74private:
     75  static const UChar m_aucIntraFilter[MAX_NUM_CHANNEL_TYPE][MAX_INTRA_FILTER_DEPTHS];
     76
    6377protected:
    64   Int*      m_piYuvExt;
    65   Int       m_iYuvExtStride;
    66   Int       m_iYuvExtHeight;
    67  
    68   TComYuv   m_acYuvPred[2];
     78  Pel*      m_piYuvExt[MAX_NUM_COMPONENT][NUM_PRED_BUF];
     79  Int       m_iYuvExtSize;
     80
     81  TComYuv   m_acYuvPred[NUM_REF_PIC_LIST_01];
    6982  TComYuv   m_cYuvPredTemp;
    70   TComYuv m_filteredBlock[4][4];
    71   TComYuv m_filteredBlockTmp[4];
    72  
     83  TComYuv m_filteredBlock[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS];
     84  TComYuv m_filteredBlockTmp[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS];
     85
    7386  TComInterpolationFilter m_if;
    7487
    75   Pel*   m_pLumaRecBuffer;       ///< array for downsampled reconstructed luma sample 
     88  Pel*   m_pLumaRecBuffer;       ///< array for downsampled reconstructed luma sample
    7689  Int    m_iLumaRecStride;       ///< stride of #m_pLumaRecBuffer array
    7790
    78   Void xPredIntraAng            (Int bitDepth, Int* pSrc, Int srcStride, Pel*& rpDst, Int dstStride, UInt width, UInt height, UInt dirMode, Bool blkAboveAvailable, Bool blkLeftAvailable, Bool bFilter );
    79   Void xPredIntraPlanar         ( Int* pSrc, Int srcStride, Pel* rpDst, Int dstStride, UInt width, UInt height );
    80  
     91  Void xPredIntraAng            ( Int bitDepth, const Pel* pSrc, Int srcStride, Pel* pDst, Int dstStride, UInt width, UInt height, ChannelType channelType, ChromaFormat format, UInt dirMode, Bool blkAboveAvailable, Bool blkLeftAvailable, const Bool bEnableEdgeFilters );
     92  Void xPredIntraPlanar         ( const Pel* pSrc, Int srcStride, Pel* rpDst, Int dstStride, UInt width, UInt height, ChannelType channelType, ChromaFormat format );
     93
    8194  // motion compensation functions
    82   Void xPredInterUni            ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi=false          );
    83   Void xPredInterBi             ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight,                         TComYuv*& rpcYuvPred );
    84   Void xPredInterLumaBlk  ( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi );
    85   Void xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi );
    86   Void xWeightedAverage         ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst );
    87  
    88   Void xGetLLSPrediction ( TComPattern* pcPattern, Int* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0 );
     95  Void xPredInterUni            ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv* pcYuvPred, Bool bi=false          );
     96  Void xPredInterBi             ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight,                         TComYuv* pcYuvPred          );
     97  Void xPredInterBlk(const ComponentID compID, TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *dstPic, Bool bi );
     98  Void xWeightedAverage         ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv* pcYuvDst );
    8999
    90   Void xDCPredFiltering( Int* pSrc, Int iSrcStride, Pel*& rpDst, Int iDstStride, Int iWidth, Int iHeight );
     100  Void xGetLLSPrediction ( const Pel* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0, const ChromaFormat chFmt  DEBUG_STRING_FN_DECLARE(sDebug) );
     101
     102  Void xDCPredFiltering( const Pel* pSrc, Int iSrcStride, Pel* pDst, Int iDstStride, Int iWidth, Int iHeight, ChannelType channelType );
    91103  Bool xCheckIdenticalMotion    ( TComDataCU* pcCU, UInt PartAddr);
    92  
     104  Void destroy();
     105
    93106#if SVC_EXTENSION
    94107  TComUpsampleFilter      m_cUsf;
     
    98111  TComPrediction();
    99112  virtual ~TComPrediction();
    100  
    101   Void    initTempBuff();
     113
     114  Void    initTempBuff(ChromaFormat chromaFormatIDC);
     115
     116  ChromaFormat getChromaFormat() const { return m_cYuvPredTemp.getChromaFormat(); }
    102117
    103118  // inter
    104119  Void motionCompensation         ( TComDataCU*  pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1 );
    105  
     120
    106121  // motion vector prediction
    107122  Void getMvPredAMVP              ( TComDataCU* pcCU, UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, TComMv& rcMvPred );
    108  
     123
    109124  // Angular Intra
    110   Void predIntraLumaAng           ( TComPattern* pcTComPattern, UInt uiDirMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft );
    111   Void predIntraChromaAng         ( Int* piSrc, UInt uiDirMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft );
    112  
    113   Pel  predIntraGetPredValDC      ( Int* pSrc, Int iSrcStride, UInt iWidth, UInt iHeight, Bool bAbove, Bool bLeft );
    114  
    115   Int* getPredicBuf()             { return m_piYuvExt;      }
    116   Int  getPredicBufWidth()        { return m_iYuvExtStride; }
    117   Int  getPredicBufHeight()       { return m_iYuvExtHeight; }
     125  Void predIntraAng               ( const ComponentID compID, UInt uiDirMode, Pel *piOrg /* Will be null for decoding */, UInt uiOrgStride, Pel* piPred, UInt uiStride, TComTU &rTu, Bool bAbove, Bool bLeft, const Bool bUseFilteredPredSamples, const Bool bUseLosslessDPCM = false );
     126
     127  Pel  predIntraGetPredValDC      ( const Pel* pSrc, Int iSrcStride, UInt iWidth, UInt iHeight, ChannelType channelType, ChromaFormat format, Bool bAbove, Bool bLeft );
     128
     129  Pel*  getPredictorPtr           ( const ComponentID compID, const Bool bUseFilteredPredictions )
     130  {
     131    return m_piYuvExt[compID][bUseFilteredPredictions?PRED_BUF_FILTERED:PRED_BUF_UNFILTERED];
     132  }
     133
     134  // This function is actually still in TComPattern.cpp
     135  /// set parameters from CU data for accessing ADI data
     136  Void initAdiPatternChType ( TComTU &rTu,
     137                              Bool&       bAbove,
     138                              Bool&       bLeft,
     139                              const ComponentID compID, const Bool bFilterRefSamples
     140                              DEBUG_STRING_FN_DECLARE(sDebug)
     141                              );
     142
     143  static Bool filteringIntraReferenceSamples(const ComponentID compID, UInt uiDirMode, UInt uiTuChWidth, UInt uiTuChHeight, const ChromaFormat chFmt, const Bool intraReferenceSmoothingDisabled);
     144
     145  static Bool UseDPCMForFirstPassIntraEstimation(TComTU &rTu, const UInt uiDirMode);
    118146
    119147#if SVC_EXTENSION
Note: See TracChangeset for help on using the changeset viewer.