source: 3DVCSoftware/branches/0.3-poznan-univ/source/Lib/TLibCommon/TComPic.h @ 28

Last change on this file since 28 was 28, checked in by poznan-univ, 13 years ago

Poznan Tools

  • Encoding only disoccluded CUs in depended views
  • Depth based motion prediction
  • Texture QP adjustment based on depth data
  • Nonlinear depth representation
  • Property svn:eol-style set to native
File size: 13.2 KB
RevLine 
[5]1/* The copyright in this software is being made available under the BSD
2 * License, included below. This software may be subject to other third party
3 * and contributor rights, including patent rights, and no such rights are
4 * granted under this license.
5 *
6 * Copyright (c) 2010-2011, ISO/IEC
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 *  * Redistributions of source code must retain the above copyright notice,
13 *    this list of conditions and the following disclaimer.
14 *  * Redistributions in binary form must reproduce the above copyright notice,
15 *    this list of conditions and the following disclaimer in the documentation
16 *    and/or other materials provided with the distribution.
17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
18 *    be used to endorse or promote products derived from this software without
19 *    specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 * THE POSSIBILITY OF SUCH DAMAGE.
32 */
[2]33
34
[5]35
[2]36/** \file     TComPic.h
37    \brief    picture class (header)
38*/
39
40#ifndef __TCOMPIC__
41#define __TCOMPIC__
42
43// Include files
44#include "CommonDef.h"
45#include "TComPicSym.h"
46#include "TComPicYuv.h"
47#include "TComBitStream.h"
48#include "TComMVDRefData.h"
49
50class SEImessages;
51
52// ====================================================================================================================
53// Class definition
54// ====================================================================================================================
55
56/// picture class (symbol + YUV buffers)
57class TComPic
58{
59private:
60  TComPicSym*           m_apcPicSym;              //  Symbol
[5]61
[2]62  TComPicYuv*           m_apcPicYuv[2];           //  Texture,  0:org / 1:rec
[28]63
64#if POZNAN_AVAIL_MAP
65  TComPicYuv*           m_apcPicYuvAvail;         //  Availability Map - Does the given pixel can be synthesised in receiver
66#endif
67
68#if POZNAN_SYNTH_VIEW
69  TComPicYuv*           m_apcPicYuvSynth;         //  Sythesied image
70#endif
71#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
72  TComPicYuv*           m_apcPicYuvSynthDepth;         //  Sythesied depth image
73#endif
74
[5]75#if DEPTH_MAP_GENERATION
[2]76  TComPicYuv*           m_pcPredDepthMap;         //  estimated depth map
[5]77#endif
78#if HHI_INTER_VIEW_MOTION_PRED
[2]79  TComPicYuv*           m_pcOrgDepthMap;          //  original depth map
[5]80#endif
81#if HHI_INTER_VIEW_RESIDUAL_PRED
[2]82  TComPicYuv*           m_pcResidual;             //  residual buffer (coded or inter-view predicted residual)
[5]83#endif
84
[2]85  TComPicYuv*           m_pcPicYuvPred;           //  Prediction
86  TComPicYuv*           m_pcPicYuvResi;           //  Residual
87#if PARALLEL_MERGED_DEBLK
88  TComPicYuv*           m_pcPicYuvDeblkBuf;
89#endif
90  Bool                  m_bReconstructed;
91  UInt                  m_uiCurrSliceIdx;         // Index of current slice
[5]92
[2]93  SEImessages* m_SEIs; ///< Any SEI messages that have been received.  If !NULL we own the object.
94
95  SliceType             m_eSliceType;
96  double                m_dQP;
97  Bool                  m_bReferenced;
98  UInt                  m_uiColDir;
99  Int                   m_aiRefPOCList[2][MAX_NUM_REF];
100  Int                   m_aiRefViewIdxList[2][MAX_NUM_REF];
101  Int                   m_aiNumRefIdx[2];    //  for multiple reference of current slice
102
103  Int                   m_iViewIdx;
[21]104#if SONY_COLPIC_AVAILABILITY
105  Int                   m_iViewOrderIdx;
106#endif
[2]107  Int**                 m_aaiCodedScale;
108  Int**                 m_aaiCodedOffset;
109
[5]110#if HHI_VSO 
[2]111  TComMVDRefData        m_cReferenceInfo;
[5]112#endif
113#if HHI_INTERVIEW_SKIP
114  TComPicYuv*           m_pcUsedPelsMap;
115#endif
[28]116#if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC
117  Double                m_dTexDqpAccordingToDepthOffset;
118  Double                m_dTexDqpAccordingToDepthMul;
119  Int                   m_iTexDqpAccordingToDepthTopBottomRow; 
120#endif
[2]121
122
123public:
124  TComPic();
125  virtual ~TComPic();
126
[5]127
[2]128  Void          create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth );
129  Void          destroy();
[5]130
[2]131  TComPicSym*   getPicSym()           { return  m_apcPicSym;    }
132  TComSlice*    getSlice(Int i)       { return  m_apcPicSym->getSlice(i);  }
133  TComSlice*    getCurrSlice()        { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx);  }
134  TComSPS*      getSPS()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getSPS();  }
135  Int           getPOC()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getPOC();  }
136#if 0
137  Bool          getDRBFlag()          { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getDRBFlag();  }
138  Int           getERBIndex()         { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getERBIndex();  }
139#endif
140  TComDataCU*&  getCU( UInt uiCUAddr )  { return  m_apcPicSym->getCU( uiCUAddr ); }
[5]141
[2]142  SliceType     getSliceType()        { return m_eSliceType ;}
143  double        getQP()               { return m_dQP ;}
144  Bool          getReferenced()       { return m_bReferenced ;}
145
146  TComPicYuv*   getPicYuvOrg()        { return  m_apcPicYuv[0]; }
147  TComPicYuv*   getPicYuvRec()        { return  m_apcPicYuv[1]; }
[5]148
[28]149#if POZNAN_AVAIL_MAP
150  TComPicYuv*   getPicYuvAvail()      { return  m_apcPicYuvAvail; } //Owieczka - returns available map from other pic image
151#endif
152
153#if POZNAN_SYNTH_VIEW
154  TComPicYuv*   getPicYuvSynth()      { return  m_apcPicYuvSynth; } //Owieczka - returns synth form other pic in image
155#endif
156#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
157  TComPicYuv*   getPicYuvSynthDepth() { return  m_apcPicYuvSynthDepth; };    //  Sythesied depth image
158#endif
159
[5]160#if DEPTH_MAP_GENERATION
[2]161  TComPicYuv*   getPredDepthMap()     { return  m_pcPredDepthMap; }
[5]162#endif
163#if HHI_INTER_VIEW_MOTION_PRED
[2]164  TComPicYuv*   getOrgDepthMap()      { return  m_pcOrgDepthMap; }
[5]165#endif
166#if HHI_INTER_VIEW_RESIDUAL_PRED
[2]167  TComPicYuv*   getResidual()         { return  m_pcResidual; }
[5]168#endif
169
170#if HHI_INTERVIEW_SKIP
[2]171  TComPicYuv*   getUsedPelsMap()      { return  m_pcUsedPelsMap; }
[5]172#endif
[2]173
174
175  TComPicYuv*   getPicYuvPred()       { return  m_pcPicYuvPred; }
176  TComPicYuv*   getPicYuvResi()       { return  m_pcPicYuvResi; }
177  Void          setPicYuvPred( TComPicYuv* pcPicYuv )       { m_pcPicYuvPred = pcPicYuv; }
178  Void          setPicYuvResi( TComPicYuv* pcPicYuv )       { m_pcPicYuvResi = pcPicYuv; }
179  Void          setQP( double dQP )   { m_dQP = dQP; }
180  Void          setSliceType( SliceType eSliceType ) { m_eSliceType = eSliceType; }
181  Void          setReferenced( Bool bReferenced )    { m_bReferenced = bReferenced; }
182  Void          setColDir( UInt uiColDir )           { m_uiColDir = uiColDir; }
183  UInt          getColDir()                          { return m_uiColDir; }
184  Void          setRefPOC( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; }
185  Int           getRefPOC( RefPicList e, Int iRefIdx )        { return m_aiRefPOCList[e][iRefIdx]; }
186  Void          setRefViewIdx( Int i, RefPicList e, Int iRefIdx ) { m_aiRefViewIdxList[e][iRefIdx] = i; }
187  Int           getRefViewIdx( RefPicList e, Int iRefIdx )        { return m_aiRefViewIdxList[e][iRefIdx]; }
188  Int           getNumRefs( RefPicList e )                    { return m_aiNumRefIdx[e]; }
189  Void          setNumRefs( Int i, RefPicList e )             { m_aiNumRefIdx[e] = i; }
190  Void          setViewIdx( Int i )                           { m_iViewIdx = i; }
191  Int           getViewIdx()                                  { return m_iViewIdx; }
[21]192#if SONY_COLPIC_AVAILABILITY
193  Void          setViewOrderIdx(Int i)                        { m_iViewOrderIdx = i; }
194  Int           getViewOrderIdx()                             { return m_iViewOrderIdx; }
195#endif
[2]196
197  Void          setScaleOffset( Int** pS, Int** pO )  { m_aaiCodedScale = pS; m_aaiCodedOffset = pO; }
198  Int**         getCodedScale ()                      { return m_aaiCodedScale;  }
199  Int**         getCodedOffset()                      { return m_aaiCodedOffset; }
200
[5]201#if HHI_VSO
[2]202  TComMVDRefData* getMVDReferenceInfo() { return &m_cReferenceInfo; }
[5]203#endif
204
[2]205  UInt          getNumCUsInFrame()      { return m_apcPicSym->getNumberOfCUsInFrame(); }
206  UInt          getNumPartInWidth()     { return m_apcPicSym->getNumPartInWidth();     }
207  UInt          getNumPartInHeight()    { return m_apcPicSym->getNumPartInHeight();    }
208  UInt          getNumPartInCU()        { return m_apcPicSym->getNumPartition();       }
209  UInt          getFrameWidthInCU()     { return m_apcPicSym->getFrameWidthInCU();     }
210  UInt          getFrameHeightInCU()    { return m_apcPicSym->getFrameHeightInCU();    }
211  UInt          getMinCUWidth()         { return m_apcPicSym->getMinCUWidth();         }
212  UInt          getMinCUHeight()        { return m_apcPicSym->getMinCUHeight();        }
[5]213
[2]214  UInt          getParPelX(UChar uhPartIdx) { return getParPelX(uhPartIdx); }
215  UInt          getParPelY(UChar uhPartIdx) { return getParPelX(uhPartIdx); }
[5]216
[2]217  Int           getStride()           { return m_apcPicYuv[1]->getStride(); }
218  Int           getCStride()          { return m_apcPicYuv[1]->getCStride(); }
[5]219
[2]220  Void          setReconMark (Bool b) { m_bReconstructed = b;     }
221  Bool          getReconMark ()       { return m_bReconstructed;  }
[5]222
[2]223#if AMVP_BUFFERCOMPRESS
[5]224  Void          compressMotion();
225#endif
[2]226  UInt          getCurrSliceIdx()            { return m_uiCurrSliceIdx;                }
227  Void          setCurrSliceIdx(UInt i)      { m_uiCurrSliceIdx = i;                   }
228  UInt          getNumAllocatedSlice()       {return m_apcPicSym->getNumAllocatedSlice();}
229  Void          allocateNewSlice()           {m_apcPicSym->allocateNewSlice();         }
230  Void          clearSliceBuffer()           {m_apcPicSym->clearSliceBuffer();         }
231
232  Void          addOriginalBuffer       ();
[28]233#if POZNAN_AVAIL_MAP
234  Void          addAvailabilityBuffer   ();
235#endif
236#if POZNAN_SYNTH_VIEW
237  Void          addSynthesisBuffer      ();
238#endif
239#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
240  Void          addSynthesisDepthBuffer ();
241#endif
[2]242#if PARALLEL_MERGED_DEBLK
243  Void          addDeblockBuffer        ();
244#endif
[5]245#if DEPTH_MAP_GENERATION
[21]246  Void          addPrdDepthMapBuffer    ( UInt uiSubSampExpX, UInt uiSubSampExpY );
[5]247#endif
248#if HHI_INTER_VIEW_MOTION_PRED
[2]249  Void          addOrgDepthMapBuffer    ();
[5]250#endif
251#if HHI_INTER_VIEW_RESIDUAL_PRED
[2]252  Void          addResidualBuffer       ();
[5]253#endif
254
255#if HHI_INTERVIEW_SKIP
[2]256  Void          addUsedPelsMapBuffer    ();
[5]257#endif
258
[2]259  Void          removeOriginalBuffer    ();
[28]260#if POZNAN_SYNTH_VIEW
261  Void          removeSynthesisBuffer   ();
262#endif
263#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
264  Void          removeSynthesisDepthBuffer ();
265#endif
266#if POZNAN_AVAIL_MAP
267  Void          removeAvailabilityBuffer();
268#endif
[2]269#if PARALLEL_MERGED_DEBLK
270  Void          removeDeblockBuffer     ();
271#endif
[5]272#if DEPTH_MAP_GENERATION
[2]273  Void          removePrdDepthMapBuffer ();
[5]274#endif
275#if HHI_INTER_VIEW_MOTION_PRED
[2]276  Void          removeOrgDepthMapBuffer ();
[5]277#endif
278#if HHI_INTER_VIEW_RESIDUAL_PRED
[2]279  Void          removeResidualBuffer    ();
[5]280#endif
281#if HHI_INTERVIEW_SKIP
[2]282  Void          removeUsedPelsMapBuffer ();
[5]283#endif
284
[28]285#if POZNAN_AVAIL_MAP
286  Void          checkSynthesisAvailability(  TComDataCU*& rpcBestCU, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied);
287#endif
288
[2]289#if PARALLEL_MERGED_DEBLK
290  TComPicYuv*   getPicYuvDeblkBuf()      { return  m_pcPicYuvDeblkBuf; }
291#endif
292
293  /** transfer ownership of @seis to @this picture */
294  void setSEIs(SEImessages* seis) { m_SEIs = seis; }
295
296  /**
297   * return the current list of SEI messages associated with this picture.
298   * Pointer is valid until @this->destroy() is called */
299  SEImessages* getSEIs() { return m_SEIs; }
300
301  /**
302   * return the current list of SEI messages associated with this picture.
303   * Pointer is valid until @this->destroy() is called */
304  const SEImessages* getSEIs() const { return m_SEIs; }
305
[28]306#if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC
307  Double getTexDqpAccordingToDepthOffset( )      { return m_dTexDqpAccordingToDepthOffset;}
308  Double getTexDqpAccordingToDepthMul( )         { return m_dTexDqpAccordingToDepthMul;}
309  Int    getTexDqpAccordingToDepthTopBottomRow( ){ return m_iTexDqpAccordingToDepthTopBottomRow;}
310  Void   setTexDqpAccordingToDepthOffset      ( Double dTexDqpAccordingToDepthOffset    ){ m_dTextureCuDeltaQpOffset       = dTexDqpAccordingToDepthOffset; }
311  Void   setTexDqpAccordingToDepthMul         ( Double dTexDqpAccordingToDepthMul       ){ m_dTexDqpAccordingToDepthMul          = dTexDqpAccordingToDepthMul; }
312  Void   setTexDqpAccordingToDepthTopBottomRow( Int iTexDqpAccordingToDepthTopBottomRow ){ m_iTexDqpAccordingToDepthTopBottomRow = iTexDqpAccordingToDepthTopBottomRow; } 
313#endif
[2]314};// END CLASS DEFINITION TComPic
315
316
317#endif // __TCOMPIC__
318
Note: See TracBrowser for help on using the repository browser.