source: 3DVCSoftware/branches/HTM-9.0r1-F0122/source/Lib/TLibEncoder/TEncTop.cpp

Last change on this file was 747, checked in by qualcomm, 10 years ago

MV-HEVC+D support based on JCT3V-F0122

  • Property svn:eol-style set to native
File size: 48.4 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
[56]4 * granted under this license. 
[5]5 *
[608]6 * Copyright (c) 2010-2013, ITU/ISO/IEC
[5]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.
[56]17 *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
[5]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/** \file     TEncTop.cpp
35    \brief    encoder class
36*/
37
[56]38#include "TLibCommon/CommonDef.h"
[2]39#include "TEncTop.h"
[56]40#include "TEncPic.h"
41#if FAST_BIT_EST
42#include "TLibCommon/ContextModel.h"
43#endif
[608]44#if H_MV
45#include "../../App/TAppEncoder/TAppEncTop.h"
46#endif
[2]47
[56]48//! \ingroup TLibEncoder
49//! \{
50
[2]51// ====================================================================================================================
52// Constructor / destructor / create / destroy
53// ====================================================================================================================
54
55TEncTop::TEncTop()
56{
57  m_iPOCLast          = -1;
58  m_iNumPicRcvd       =  0;
59  m_uiNumAllPicCoded  =  0;
60  m_pppcRDSbacCoder   =  NULL;
61  m_pppcBinCoderCABAC =  NULL;
62  m_cRDGoOnSbacCoder.init( &m_cRDGoOnBinCoderCABAC );
63#if ENC_DEC_TRACE
64  g_hTrace = fopen( "TraceEnc.txt", "wb" );
65  g_bJustDoIt = g_bEncDecTraceDisable;
66  g_nSymbolCounter = 0;
67#endif
[56]68
69  m_iMaxRefPicNum     = 0;
70
71#if FAST_BIT_EST
72  ContextModel::buildNextStateTable();
73#endif
74
75  m_pcSbacCoders           = NULL;
76  m_pcBinCoderCABACs       = NULL;
77  m_ppppcRDSbacCoders      = NULL;
78  m_ppppcBinCodersCABAC    = NULL;
79  m_pcRDGoOnSbacCoders     = NULL;
80  m_pcRDGoOnBinCodersCABAC = NULL;
81  m_pcBitCounters          = NULL;
82  m_pcRdCosts              = NULL;
[608]83#if H_MV
84  m_ivPicLists = NULL;
85#endif
[2]86}
87
88TEncTop::~TEncTop()
89{
90#if ENC_DEC_TRACE
91  fclose( g_hTrace );
92#endif
93}
94
95Void TEncTop::create ()
96{
[608]97#if !H_MV
[2]98  // initialize global variables
[608]99  initROM();
100#endif
101 
[2]102  // create processing unit classes
[608]103  m_cGOPEncoder.        create();
[2]104  m_cSliceEncoder.      create( getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
105  m_cCuEncoder.         create( g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight );
106  if (m_bUseSAO)
107  {
[443]108    m_cEncSAO.setSaoLcuBoundary(getSaoLcuBoundary());
109    m_cEncSAO.setSaoLcuBasedOptimization(getSaoLcuBasedOptimization());
[56]110    m_cEncSAO.setMaxNumOffsetsPerPic(getMaxNumOffsetsPerPic());
[608]111    m_cEncSAO.create( getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight );
[2]112    m_cEncSAO.createEncBuffer();
113  }
[56]114#if ADAPTIVE_QP_SELECTION
115  if (m_bUseAdaptQpSelect)
116  {
117    m_cTrQuant.initSliceQpDelta();
118  }
[2]119#endif
120  m_cLoopFilter.        create( g_uiMaxCUDepth );
121
[608]122#if RATE_CONTROL_LAMBDA_DOMAIN
123  if ( m_RCEnableRateControl )
[2]124  {
[655]125#if KWU_RC_MADPRED_E0227
[608]126    m_cRateCtrl.init( m_framesToBeEncoded, m_RCTargetBitrate, m_iFrameRate, m_iGOPSize, m_iSourceWidth, m_iSourceHeight,
[655]127      g_uiMaxCUWidth, g_uiMaxCUHeight, m_RCKeepHierarchicalBit, m_RCUseLCUSeparateModel, m_GOPList, getLayerId() );
128#else
129    m_cRateCtrl.init( m_framesToBeEncoded, m_RCTargetBitrate, m_iFrameRate, m_iGOPSize, m_iSourceWidth, m_iSourceHeight,
[608]130                      g_uiMaxCUWidth, g_uiMaxCUHeight, m_RCKeepHierarchicalBit, m_RCUseLCUSeparateModel, m_GOPList );
[655]131#endif
[2]132  }
[608]133#else
[655]134#if KWU_FIX_URQ
135  if(m_enableRateCtrl)
[608]136#endif
[655]137    m_cRateCtrl.create(getIntraPeriod(), getGOPSize(), getFrameRate(), getTargetBitrate(), getQP(), getNumLCUInUnit(), getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight);
138#endif
[2]139  // if SBAC-based RD optimization is used
140  if( m_bUseSBACRD )
141  {
[56]142    m_pppcRDSbacCoder = new TEncSbac** [g_uiMaxCUDepth+1];
143#if FAST_BIT_EST
144    m_pppcBinCoderCABAC = new TEncBinCABACCounter** [g_uiMaxCUDepth+1];
145#else
146    m_pppcBinCoderCABAC = new TEncBinCABAC** [g_uiMaxCUDepth+1];
147#endif
148   
149    for ( Int iDepth = 0; iDepth < g_uiMaxCUDepth+1; iDepth++ )
[2]150    {
151      m_pppcRDSbacCoder[iDepth] = new TEncSbac* [CI_NUM];
[56]152#if FAST_BIT_EST
153      m_pppcBinCoderCABAC[iDepth] = new TEncBinCABACCounter* [CI_NUM];
154#else
[2]155      m_pppcBinCoderCABAC[iDepth] = new TEncBinCABAC* [CI_NUM];
[56]156#endif
157     
[2]158      for (Int iCIIdx = 0; iCIIdx < CI_NUM; iCIIdx ++ )
159      {
160        m_pppcRDSbacCoder[iDepth][iCIIdx] = new TEncSbac;
[56]161#if FAST_BIT_EST
162        m_pppcBinCoderCABAC [iDepth][iCIIdx] = new TEncBinCABACCounter;
163#else
[2]164        m_pppcBinCoderCABAC [iDepth][iCIIdx] = new TEncBinCABAC;
[56]165#endif
[2]166        m_pppcRDSbacCoder   [iDepth][iCIIdx]->init( m_pppcBinCoderCABAC [iDepth][iCIIdx] );
167      }
168    }
169  }
170}
171
[56]172/**
173 - Allocate coders required for wavefront for the nominated number of substreams.
174 .
175 \param iNumSubstreams Determines how much information to allocate.
176 */
177Void TEncTop::createWPPCoders(Int iNumSubstreams)
178{
179  if (m_pcSbacCoders != NULL)
[608]180  {
[56]181    return; // already generated.
[608]182  }
[56]183
184  m_iNumSubstreams         = iNumSubstreams;
185  m_pcSbacCoders           = new TEncSbac       [iNumSubstreams];
186  m_pcBinCoderCABACs       = new TEncBinCABAC   [iNumSubstreams];
187  m_pcRDGoOnSbacCoders     = new TEncSbac       [iNumSubstreams];
188  m_pcRDGoOnBinCodersCABAC = new TEncBinCABAC   [iNumSubstreams];
189  m_pcBitCounters          = new TComBitCounter [iNumSubstreams];
190  m_pcRdCosts              = new TComRdCost     [iNumSubstreams];
191
192  for ( UInt ui = 0 ; ui < iNumSubstreams; ui++ )
193  {
194    m_pcRDGoOnSbacCoders[ui].init( &m_pcRDGoOnBinCodersCABAC[ui] );
195    m_pcSbacCoders[ui].init( &m_pcBinCoderCABACs[ui] );
196  }
197  if( m_bUseSBACRD )
198  {
199    m_ppppcRDSbacCoders      = new TEncSbac***    [iNumSubstreams];
200    m_ppppcBinCodersCABAC    = new TEncBinCABAC***[iNumSubstreams];
201    for ( UInt ui = 0 ; ui < iNumSubstreams ; ui++ )
202    {
203      m_ppppcRDSbacCoders[ui]  = new TEncSbac** [g_uiMaxCUDepth+1];
204      m_ppppcBinCodersCABAC[ui]= new TEncBinCABAC** [g_uiMaxCUDepth+1];
205     
206      for ( Int iDepth = 0; iDepth < g_uiMaxCUDepth+1; iDepth++ )
207      {
208        m_ppppcRDSbacCoders[ui][iDepth]  = new TEncSbac*     [CI_NUM];
209        m_ppppcBinCodersCABAC[ui][iDepth]= new TEncBinCABAC* [CI_NUM];
210
211        for (Int iCIIdx = 0; iCIIdx < CI_NUM; iCIIdx ++ )
212        {
213          m_ppppcRDSbacCoders  [ui][iDepth][iCIIdx] = new TEncSbac;
214          m_ppppcBinCodersCABAC[ui][iDepth][iCIIdx] = new TEncBinCABAC;
215          m_ppppcRDSbacCoders  [ui][iDepth][iCIIdx]->init( m_ppppcBinCodersCABAC[ui][iDepth][iCIIdx] );
216        }
217      }
218    }
219  }
220}
221
[2]222Void TEncTop::destroy ()
223{
224  // destroy processing unit classes
[56]225  m_cGOPEncoder.        destroy();
[2]226  m_cSliceEncoder.      destroy();
227  m_cCuEncoder.         destroy();
228  if (m_cSPS.getUseSAO())
229  {
230    m_cEncSAO.destroy();
[56]231    m_cEncSAO.destroyEncBuffer();
[2]232  }
233  m_cLoopFilter.        destroy();
[608]234  m_cRateCtrl.          destroy();
[2]235  // SBAC RD
236  if( m_bUseSBACRD )
237  {
238    Int iDepth;
239    for ( iDepth = 0; iDepth < g_uiMaxCUDepth+1; iDepth++ )
240    {
241      for (Int iCIIdx = 0; iCIIdx < CI_NUM; iCIIdx ++ )
242      {
243        delete m_pppcRDSbacCoder[iDepth][iCIIdx];
244        delete m_pppcBinCoderCABAC[iDepth][iCIIdx];
245      }
246    }
[56]247   
[2]248    for ( iDepth = 0; iDepth < g_uiMaxCUDepth+1; iDepth++ )
249    {
250      delete [] m_pppcRDSbacCoder[iDepth];
251      delete [] m_pppcBinCoderCABAC[iDepth];
252    }
[56]253   
[2]254    delete [] m_pppcRDSbacCoder;
255    delete [] m_pppcBinCoderCABAC;
[56]256
257    for ( UInt ui = 0; ui < m_iNumSubstreams; ui++ )
258    {
259      for ( iDepth = 0; iDepth < g_uiMaxCUDepth+1; iDepth++ )
260      {
261        for (Int iCIIdx = 0; iCIIdx < CI_NUM; iCIIdx ++ )
262        {
263          delete m_ppppcRDSbacCoders  [ui][iDepth][iCIIdx];
264          delete m_ppppcBinCodersCABAC[ui][iDepth][iCIIdx];
265        }
266      }
267
268      for ( iDepth = 0; iDepth < g_uiMaxCUDepth+1; iDepth++ )
269      {
270        delete [] m_ppppcRDSbacCoders  [ui][iDepth];
271        delete [] m_ppppcBinCodersCABAC[ui][iDepth];
272      }
273      delete[] m_ppppcRDSbacCoders  [ui];
274      delete[] m_ppppcBinCodersCABAC[ui];
275    }
276    delete[] m_ppppcRDSbacCoders;
277    delete[] m_ppppcBinCodersCABAC;
[2]278  }
[56]279  delete[] m_pcSbacCoders;
280  delete[] m_pcBinCoderCABACs;
281  delete[] m_pcRDGoOnSbacCoders; 
282  delete[] m_pcRDGoOnBinCodersCABAC;
283  delete[] m_pcBitCounters;
284  delete[] m_pcRdCosts;
285 
[608]286#if !H_MV
287    // destroy ROM
[56]288  destroyROM();
[608]289#endif
290
[2]291  return;
292}
293
[655]294#if KWU_RC_MADPRED_E0227
295Void TEncTop::init(TAppEncTop* pcTAppEncTop, Bool isFieldCoding)
296#else
297Void TEncTop::init(Bool isFieldCoding)
298#endif
[2]299{
300  // initialize SPS
301  xInitSPS();
[56]302 
[608]303  /* set the VPS profile information */
304#if H_MV
305  // This seems to be incorrect, but irrelevant for the MV-HEVC
306  *(m_cVPS->getPTL()) = *m_cSPS.getPTL();
307  m_cVPS->getTimingInfo()->setTimingInfoPresentFlag       ( false );
308#else
309  *m_cVPS.getPTL() = *m_cSPS.getPTL();
310  m_cVPS.getTimingInfo()->setTimingInfoPresentFlag       ( false );
311#endif
[2]312  // initialize PPS
[56]313  m_cPPS.setSPS(&m_cSPS);
[2]314  xInitPPS();
[655]315  xInitRPS(isFieldCoding);
[2]316
[56]317  xInitPPSforTiles();
318
[2]319  // initialize processing unit classes
[56]320  m_cGOPEncoder.  init( this );
[2]321  m_cSliceEncoder.init( this );
322  m_cCuEncoder.   init( this );
[56]323 
[655]324#if KWU_RC_MADPRED_E0227
325  m_pcTAppEncTop = pcTAppEncTop;
326#endif
[2]327  // initialize transform & quantization class
328  m_pcCavlcCoder = getCavlcCoder();
[56]329 
[608]330  m_cTrQuant.init( 1 << m_uiQuadtreeTULog2MaxSize,
331                  m_useRDOQ, 
332                  m_useRDOQTS,
333                  true 
334                  ,m_useTransformSkipFast
[56]335#if ADAPTIVE_QP_SELECTION                 
336                  , m_bUseAdaptQpSelect
[2]337#endif
[56]338                  );
339 
[2]340  // initialize encoder search class
341  m_cSearch.init( this, &m_cTrQuant, m_iSearchRange, m_bipredSearchRange, m_iFastSearch, 0, &m_cEntropyCoder, &m_cRdCost, getRDSbacCoder(), getRDGoOnSbacCoder() );
[56]342
343  m_iMaxRefPicNum = 0;
[2]344}
345
346// ====================================================================================================================
347// Public member functions
348// ====================================================================================================================
349
[608]350#if H_MV
351Void TEncTop::initNewPic( TComPicYuv* pcPicYuvOrg )
[56]352{
353  TComPic* pcPicCurr = NULL;
354
355  // get original YUV
356  xGetNewPicBuffer( pcPicCurr );
357  pcPicYuvOrg->copyToPic( pcPicCurr->getPicYuvOrg() );
358
359  // compute image characteristics
360  if ( getUseAdaptiveQP() )
361  {
362    m_cPreanalyzer.xPreanalyze( dynamic_cast<TEncPic*>( pcPicCurr ) );
363  }
[608]364#if H_MV
365  pcPicCurr->setLayerId( getLayerId()); 
366#endif
367#if H_3D
368  pcPicCurr->setScaleOffset( m_aaiCodedScale, m_aaiCodedOffset );
369#endif
[56]370}
[608]371#endif
[2]372Void TEncTop::deletePicBuffer()
373{
374  TComList<TComPic*>::iterator iterPic = m_cListPic.begin();
375  Int iSize = Int( m_cListPic.size() );
[56]376 
[2]377  for ( Int i = 0; i < iSize; i++ )
378  {
379    TComPic* pcPic = *(iterPic++);
[56]380   
[2]381    pcPic->destroy();
382    delete pcPic;
383    pcPic = NULL;
384  }
385}
386
387/**
388 - Application has picture buffer list with size of GOP + 1
389 - Picture buffer list acts like as ring buffer
390 - End of the list has the latest picture
391 .
[608]392 \param   flush               cause encoder to encode a partial GOP
[2]393 \param   pcPicYuvOrg         original YUV picture
394 \retval  rcListPicYuvRecOut  list of reconstruction YUV pictures
395 \retval  rcListBitstreamOut  list of output bitstreams
396 \retval  iNumEncoded         number of encoded pictures
397 */
[608]398#if H_MV
399Void TEncTop::encode(Bool flush, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded , Int gopId )
400{
401#else
402Void TEncTop::encode(Bool flush, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded )
403{
404#endif
[747]405#if H_3DV
[608]406  TComPic* picLastCoded = getPic( getGOPEncoder()->getPocLastCoded() );
407  if( picLastCoded )
408  {
409    picLastCoded->compressMotion(1); 
410  }
411#endif
412#if H_MV
[56]413  if( gopId == 0)
[2]414  {
[56]415    m_cGOPEncoder.initGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut); 
[608]416#else
417  if (pcPicYuvOrg) {
418    // get original YUV
419    TComPic* pcPicCurr = NULL;
420    xGetNewPicBuffer( pcPicCurr );
421    pcPicYuvOrg->copyToPic( pcPicCurr->getPicYuvOrg() );
422
423    // compute image characteristics
424    if ( getUseAdaptiveQP() )
425    {
426      m_cPreanalyzer.xPreanalyze( dynamic_cast<TEncPic*>( pcPicCurr ) );
427    }
[2]428  }
[608]429 
430  if (!m_iNumPicRcvd || (!flush && m_iPOCLast != 0 && m_iNumPicRcvd != m_iGOPSize && m_iGOPSize))
[2]431  {
[608]432    iNumEncoded = 0;
433    return;
[2]434  }
[608]435#endif
[56]436 
[608]437#if RATE_CONTROL_LAMBDA_DOMAIN
438  if ( m_RCEnableRateControl )
[2]439  {
[608]440    m_cRateCtrl.initRCGOP( m_iNumPicRcvd );
[2]441  }
[608]442#endif
[2]443
[608]444#if H_MV
445  }
[655]446  m_cGOPEncoder.compressPicInGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut, gopId, false, false );
[2]447
[608]448  if( gopId + 1 == m_cGOPEncoder.getGOPSize() )
[2]449  {
[608]450#else
451  // compress GOP
[655]452  m_cGOPEncoder.compressGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut, false, false);
[5]453#endif
[2]454
[608]455#if RATE_CONTROL_LAMBDA_DOMAIN
456  if ( m_RCEnableRateControl )
[2]457  {
[608]458    m_cRateCtrl.destroyRCGOP();
[2]459  }
[608]460#endif
461 
462  iNumEncoded         = m_iNumPicRcvd;
463  m_iNumPicRcvd       = 0;
464  m_uiNumAllPicCoded += iNumEncoded;
465#if H_MV
[2]466}
[608]467#endif
468}
[655]469/**------------------------------------------------
470 Separate interlaced frame into two fields
471 -------------------------------------------------**/
472void separateFields(Pel* org, Pel* dstField, UInt stride, UInt width, UInt height, bool isTop)
473{
474  if (!isTop)
475  {
476    org += stride;
477  }
478  for (Int y = 0; y < height>>1; y++)
479  {
480    for (Int x = 0; x < width; x++)
481    {
482      dstField[x] = org[x];
483    }
484   
485    dstField += stride;
486    org += stride*2;
487  }
488 
489}
[2]490
[655]491#if H_MV
492Void TEncTop::encode(Bool flush, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded, bool isTff, Int gopId )
493{
494  assert( 0 ); // Field coding and multiview need to be furhter harmonized.
495}
496#else
497Void TEncTop::encode(Bool flush, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded, bool isTff)
498{
499  /* -- TOP FIELD -- */
500 
501  if (pcPicYuvOrg)
502  {
503   
504    /* -- Top field initialization -- */
505   
506    TComPic *pcTopField;
507    xGetNewPicBuffer( pcTopField );
508    pcTopField->getPicSym()->allocSaoParam(&m_cEncSAO);
509    pcTopField->setReconMark (false);
510   
511    pcTopField->getSlice(0)->setPOC( m_iPOCLast );
512    pcTopField->getPicYuvRec()->setBorderExtension(false);
513    pcTopField->setTopField(isTff);
514   
515    int nHeight = pcPicYuvOrg->getHeight();
516    int nWidth = pcPicYuvOrg->getWidth();
517    int nStride = pcPicYuvOrg->getStride();
518    int nPadLuma = pcPicYuvOrg->getLumaMargin();
519    int nPadChroma = pcPicYuvOrg->getChromaMargin();
520   
521    // Get pointers
522    Pel * PicBufY = pcPicYuvOrg->getBufY();
523    Pel * PicBufU = pcPicYuvOrg->getBufU();
524    Pel * PicBufV = pcPicYuvOrg->getBufV();
525   
526    Pel * pcTopFieldY =  pcTopField->getPicYuvOrg()->getLumaAddr();
527    Pel * pcTopFieldU =  pcTopField->getPicYuvOrg()->getCbAddr();
528    Pel * pcTopFieldV =  pcTopField->getPicYuvOrg()->getCrAddr();
529   
530    // compute image characteristics
531    if ( getUseAdaptiveQP() )
532    {
533      m_cPreanalyzer.xPreanalyze( dynamic_cast<TEncPic*>( pcTopField ) );
534    }
535   
536    /* -- Defield -- */
537   
538    bool isTop = isTff;
539   
540    separateFields(PicBufY + nPadLuma + nStride*nPadLuma, pcTopFieldY, nStride, nWidth, nHeight, isTop);
541    separateFields(PicBufU + nPadChroma + (nStride >> 1)*nPadChroma, pcTopFieldU, nStride >> 1, nWidth >> 1, nHeight >> 1, isTop);
542    separateFields(PicBufV + nPadChroma + (nStride >> 1)*nPadChroma, pcTopFieldV, nStride >> 1, nWidth >> 1, nHeight >> 1, isTop);
543   
544  }
545 
546  if (m_iPOCLast == 0) // compress field 0
547  {
548    m_cGOPEncoder.compressGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut, true, isTff);
549  }
550 
551  /* -- BOTTOM FIELD -- */
552 
553  if (pcPicYuvOrg)
554  {
555   
556    /* -- Bottom field initialization -- */
557   
558    TComPic* pcBottomField;
559    xGetNewPicBuffer( pcBottomField );
560    pcBottomField->getPicSym()->allocSaoParam(&m_cEncSAO);
561    pcBottomField->setReconMark (false);
562   
563    TComPicYuv* rpcPicYuvRec = new TComPicYuv;
564    if ( rcListPicYuvRecOut.size() == (UInt)m_iGOPSize )
565    {
566      rpcPicYuvRec = rcListPicYuvRecOut.popFront();
567    }
568    else
569    {
570      rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
571    }
572    rcListPicYuvRecOut.pushBack( rpcPicYuvRec );
573   
574    pcBottomField->getSlice(0)->setPOC( m_iPOCLast);
575    pcBottomField->getPicYuvRec()->setBorderExtension(false);
576    pcBottomField->setTopField(!isTff);
577   
578    int nHeight = pcPicYuvOrg->getHeight();
579    int nWidth = pcPicYuvOrg->getWidth();
580    int nStride = pcPicYuvOrg->getStride();
581    int nPadLuma = pcPicYuvOrg->getLumaMargin();
582    int nPadChroma = pcPicYuvOrg->getChromaMargin();
583   
584    // Get pointers
585    Pel * PicBufY = pcPicYuvOrg->getBufY();
586    Pel * PicBufU = pcPicYuvOrg->getBufU();
587    Pel * PicBufV = pcPicYuvOrg->getBufV();
588   
589    Pel * pcBottomFieldY =  pcBottomField->getPicYuvOrg()->getLumaAddr();
590    Pel * pcBottomFieldU =  pcBottomField->getPicYuvOrg()->getCbAddr();
591    Pel * pcBottomFieldV =  pcBottomField->getPicYuvOrg()->getCrAddr();
592   
593    // Compute image characteristics
594    if ( getUseAdaptiveQP() )
595    {
596      m_cPreanalyzer.xPreanalyze( dynamic_cast<TEncPic*>( pcBottomField ) );
597    }
598   
599    /* -- Defield -- */
600   
601    bool isTop = !isTff;
602   
603    separateFields(PicBufY + nPadLuma + nStride*nPadLuma, pcBottomFieldY, nStride, nWidth, nHeight, isTop);
604    separateFields(PicBufU + nPadChroma + (nStride >> 1)*nPadChroma, pcBottomFieldU, nStride >> 1, nWidth >> 1, nHeight >> 1, isTop);
605    separateFields(PicBufV + nPadChroma + (nStride >> 1)*nPadChroma, pcBottomFieldV, nStride >> 1, nWidth >> 1, nHeight >> 1, isTop);
606   
607  }
608 
609  if ( ( !(m_iNumPicRcvd) || (!flush && m_iPOCLast != 1 && m_iNumPicRcvd != m_iGOPSize && m_iGOPSize)) )
610  {
611    iNumEncoded = 0;
612    return;
613  }
614 
615  // compress GOP
616  m_cGOPEncoder.compressGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut, true, isTff);
617 
618  iNumEncoded = m_iNumPicRcvd;
619  m_iNumPicRcvd = 0;
620  m_uiNumAllPicCoded += iNumEncoded;
621}
622#endif
623
624
625
[2]626// ====================================================================================================================
627// Protected member functions
628// ====================================================================================================================
629
630/**
631 - Application has picture buffer list with size of GOP + 1
632 - Picture buffer list acts like as ring buffer
633 - End of the list has the latest picture
634 .
635 \retval rpcPic obtained picture buffer
636 */
637Void TEncTop::xGetNewPicBuffer ( TComPic*& rpcPic )
638{
639  TComSlice::sortPicList(m_cListPic);
[56]640 
641  if (m_cListPic.size() >= (UInt)(m_iGOPSize + getMaxDecPicBuffering(MAX_TLAYER-1) + 2) )
[2]642  {
[56]643    TComList<TComPic*>::iterator iterPic  = m_cListPic.begin();
644    Int iSize = Int( m_cListPic.size() );
645    for ( Int i = 0; i < iSize; i++ )
646    {
[608]647      rpcPic = *(iterPic++);
[56]648      if(rpcPic->getSlice(0)->isReferenced() == false)
[608]649      {
650        break;
651      }
[56]652    }
[2]653  }
654  else
655  {
[608]656    if ( getUseAdaptiveQP() )
657    {
658      TEncPic* pcEPic = new TEncPic;
659      pcEPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 ,
660                      m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics);
661      rpcPic = pcEPic;
662    }
663    else
664    {
665      rpcPic = new TComPic;
666
667      rpcPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 
668                      m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics);
669    }
670    if (getUseSAO())
671    {
672      rpcPic->getPicSym()->allocSaoParam(&m_cEncSAO);
673    }
[56]674    m_cListPic.pushBack( rpcPic );
[2]675  }
676  rpcPic->setReconMark (false);
[56]677 
[2]678  m_iPOCLast++;
679  m_iNumPicRcvd++;
[56]680 
[2]681  rpcPic->getSlice(0)->setPOC( m_iPOCLast );
682  // mark it should be extended
683  rpcPic->getPicYuvRec()->setBorderExtension(false);
[622]684
685#if H_MV
[608]686  rpcPic->getPicYuvOrg()->setBorderExtension(false);
[622]687#endif
[2]688}
689
690Void TEncTop::xInitSPS()
691{
[608]692#if H_MV
693  m_cSPS.setSPSId( getLayerIdInVps() );
694  m_cSPS.setLayerId( getLayerId() );
695#endif
696  ProfileTierLevel& profileTierLevel = *m_cSPS.getPTL()->getGeneralPTL();
697  profileTierLevel.setLevelIdc(m_level);
698  profileTierLevel.setTierFlag(m_levelTier);
699  profileTierLevel.setProfileIdc(m_profile);
700  profileTierLevel.setProfileCompatibilityFlag(m_profile, 1);
701  profileTierLevel.setProgressiveSourceFlag(m_progressiveSourceFlag);
702  profileTierLevel.setInterlacedSourceFlag(m_interlacedSourceFlag);
703  profileTierLevel.setNonPackedConstraintFlag(m_nonPackedConstraintFlag);
704  profileTierLevel.setFrameOnlyConstraintFlag(m_frameOnlyConstraintFlag);
705 
706  if (m_profile == Profile::MAIN10 && g_bitDepthY == 8 && g_bitDepthC == 8)
707  {
708    /* The above constraint is equal to Profile::MAIN */
709    profileTierLevel.setProfileCompatibilityFlag(Profile::MAIN, 1);
710  }
711  if (m_profile == Profile::MAIN)
712  {
713    /* A Profile::MAIN10 decoder can always decode Profile::MAIN */
714    profileTierLevel.setProfileCompatibilityFlag(Profile::MAIN10, 1);
715  }
716  /* XXX: should Main be marked as compatible with still picture? */
717  /* XXX: may be a good idea to refactor the above into a function
718   * that chooses the actual compatibility based upon options */
719
[622]720#if H_MV 
721  m_cSPS.setUpdateRepFormatFlag           ( m_layerId == 0 );   
722  m_cSPS.setSpsInferScalingListFlag       ( m_layerId > 0 && m_cVPS->getInDirectDependencyFlag( getLayerIdInVps(), 0 ) ); 
723  m_cSPS.setSpsScalingListRefLayerId      ( 0              ); 
724#endif
[56]725  m_cSPS.setPicWidthInLumaSamples         ( m_iSourceWidth      );
726  m_cSPS.setPicHeightInLumaSamples        ( m_iSourceHeight     );
[608]727  m_cSPS.setConformanceWindow             ( m_conformanceWindow );
[2]728  m_cSPS.setMaxCUWidth    ( g_uiMaxCUWidth      );
729  m_cSPS.setMaxCUHeight   ( g_uiMaxCUHeight     );
730  m_cSPS.setMaxCUDepth    ( g_uiMaxCUDepth      );
[608]731
732  Int minCUSize = m_cSPS.getMaxCUWidth() >> ( m_cSPS.getMaxCUDepth()-g_uiAddCUDepth );
733  Int log2MinCUSize = 0;
734  while(minCUSize > 1)
735  {
736    minCUSize >>= 1;
737    log2MinCUSize++;
738  }
739
740  m_cSPS.setLog2MinCodingBlockSize(log2MinCUSize);
741  m_cSPS.setLog2DiffMaxMinCodingBlockSize(m_cSPS.getMaxCUDepth()-g_uiAddCUDepth);
[56]742 
743  m_cSPS.setPCMLog2MinSize (m_uiPCMLog2MinSize);
744  m_cSPS.setUsePCM        ( m_usePCM           );
745  m_cSPS.setPCMLog2MaxSize( m_pcmLog2MaxSize  );
[2]746
747  m_cSPS.setQuadtreeTULog2MaxSize( m_uiQuadtreeTULog2MaxSize );
748  m_cSPS.setQuadtreeTULog2MinSize( m_uiQuadtreeTULog2MinSize );
749  m_cSPS.setQuadtreeTUMaxDepthInter( m_uiQuadtreeTUMaxDepthInter    );
750  m_cSPS.setQuadtreeTUMaxDepthIntra( m_uiQuadtreeTUMaxDepthIntra    );
[56]751 
[608]752  m_cSPS.setTMVPFlagsPresent(false);
[56]753  m_cSPS.setUseLossless   ( m_useLossless  );
[608]754
[56]755  m_cSPS.setMaxTrSize   ( 1 << m_uiQuadtreeTULog2MaxSize );
756 
757  Int i;
758 
[608]759  for (i = 0; i < g_uiMaxCUDepth-g_uiAddCUDepth; i++ )
[56]760  {
761    m_cSPS.setAMPAcc( i, m_useAMP );
762    //m_cSPS.setAMPAcc( i, 1 );
763  }
[2]764
[56]765  m_cSPS.setUseAMP ( m_useAMP );
[2]766
[608]767#if H_3D_QTLPC
[747]768#if H_3DV
[608]769  m_cSPS.setUseQTL( m_bUseQTL );
770  m_cSPS.setUsePC ( m_bUsePC  );
[747]771#else
772  m_cSPS.setUseQTL( m_bUseQTL );
773  m_cSPS.setUsePC ( 0 );
774#endif
[608]775#endif
776
777  for (i = g_uiMaxCUDepth-g_uiAddCUDepth; i < g_uiMaxCUDepth; i++ )
[56]778  {
779    m_cSPS.setAMPAcc(i, 0);
780  }
781
[608]782  m_cSPS.setBitDepthY( g_bitDepthY );
783  m_cSPS.setBitDepthC( g_bitDepthC );
[2]784
[608]785  m_cSPS.setQpBDOffsetY ( 6*(g_bitDepthY - 8) );
786  m_cSPS.setQpBDOffsetC ( 6*(g_bitDepthC - 8) );
787
[56]788  m_cSPS.setUseSAO( m_bUseSAO );
[2]789
[56]790  m_cSPS.setMaxTLayers( m_maxTempLayer );
[608]791  m_cSPS.setTemporalIdNestingFlag( ( m_maxTempLayer == 1 ) ? true : false );
[56]792  for ( i = 0; i < m_cSPS.getMaxTLayers(); i++ )
793  {
794    m_cSPS.setMaxDecPicBuffering(m_maxDecPicBuffering[i], i);
795    m_cSPS.setNumReorderPics(m_numReorderPics[i], i);
796  }
797  m_cSPS.setPCMBitDepthLuma (g_uiPCMBitDepthLuma);
798  m_cSPS.setPCMBitDepthChroma (g_uiPCMBitDepthChroma);
799  m_cSPS.setPCMFilterDisableFlag  ( m_bPCMFilterDisableFlag );
[42]800
[56]801  m_cSPS.setScalingListFlag ( (m_useScalingListId == 0) ? 0 : 1 );
802
[608]803  m_cSPS.setUseStrongIntraSmoothing( m_useStrongIntraSmoothing );
[210]804
[608]805  m_cSPS.setVuiParametersPresentFlag(getVuiParametersPresentFlag());
806  if (m_cSPS.getVuiParametersPresentFlag())
[56]807  {
[608]808    TComVUI* pcVUI = m_cSPS.getVuiParameters();
809    pcVUI->setAspectRatioInfoPresentFlag(getAspectRatioIdc() != -1);
810    pcVUI->setAspectRatioIdc(getAspectRatioIdc());
811    pcVUI->setSarWidth(getSarWidth());
812    pcVUI->setSarHeight(getSarHeight());
813    pcVUI->setOverscanInfoPresentFlag(getOverscanInfoPresentFlag());
814    pcVUI->setOverscanAppropriateFlag(getOverscanAppropriateFlag());
815    pcVUI->setVideoSignalTypePresentFlag(getVideoSignalTypePresentFlag());
816    pcVUI->setVideoFormat(getVideoFormat());
817    pcVUI->setVideoFullRangeFlag(getVideoFullRangeFlag());
818    pcVUI->setColourDescriptionPresentFlag(getColourDescriptionPresentFlag());
819    pcVUI->setColourPrimaries(getColourPrimaries());
820    pcVUI->setTransferCharacteristics(getTransferCharacteristics());
821    pcVUI->setMatrixCoefficients(getMatrixCoefficients());
822    pcVUI->setChromaLocInfoPresentFlag(getChromaLocInfoPresentFlag());
823    pcVUI->setChromaSampleLocTypeTopField(getChromaSampleLocTypeTopField());
824    pcVUI->setChromaSampleLocTypeBottomField(getChromaSampleLocTypeBottomField());
825    pcVUI->setNeutralChromaIndicationFlag(getNeutralChromaIndicationFlag());
826    pcVUI->setDefaultDisplayWindow(getDefaultDisplayWindow());
827    pcVUI->setFrameFieldInfoPresentFlag(getFrameFieldInfoPresentFlag());
828    pcVUI->setFieldSeqFlag(false);
829    pcVUI->setHrdParametersPresentFlag(false);
830    pcVUI->getTimingInfo()->setPocProportionalToTimingFlag(getPocProportionalToTimingFlag());
831    pcVUI->getTimingInfo()->setNumTicksPocDiffOneMinus1   (getNumTicksPocDiffOneMinus1()   );
832    pcVUI->setBitstreamRestrictionFlag(getBitstreamRestrictionFlag());
833    pcVUI->setTilesFixedStructureFlag(getTilesFixedStructureFlag());
834    pcVUI->setMotionVectorsOverPicBoundariesFlag(getMotionVectorsOverPicBoundariesFlag());
835    pcVUI->setMinSpatialSegmentationIdc(getMinSpatialSegmentationIdc());
836    pcVUI->setMaxBytesPerPicDenom(getMaxBytesPerPicDenom());
837    pcVUI->setMaxBitsPerMinCuDenom(getMaxBitsPerMinCuDenom());
838    pcVUI->setLog2MaxMvLengthHorizontal(getLog2MaxMvLengthHorizontal());
839    pcVUI->setLog2MaxMvLengthVertical(getLog2MaxMvLengthVertical());
[2]840  }
[608]841#if H_3D
[724]842#if !QC_DEPTH_IV_MRG_F0125
[608]843  if ( !m_isDepth )
[724]844#endif
[2]845  {
[608]846    m_cSPS.initCamParaSPS           ( m_viewIndex, m_uiCamParPrecision, m_bCamParInSliceHeader, m_aaiCodedScale, m_aaiCodedOffset );
847  }
[210]848#endif
[56]849}
[2]850
[56]851Void TEncTop::xInitPPS()
852{
[608]853#if H_MV
[622]854  m_cPPS.setLayerId( getLayerId() );
855  if( getVPS()->getNumDirectRefLayers( getLayerId() ) > 0 )
[608]856  {
857    m_cPPS.setListsModificationPresentFlag( true );
858  }
859  m_cPPS.setPPSId( getLayerIdInVps() );
860  m_cPPS.setSPSId( getLayerIdInVps() );
861#endif
[56]862  m_cPPS.setConstrainedIntraPred( m_bUseConstrainedIntraPred );
863  Bool bUseDQP = (getMaxCuDQPDepth() > 0)? true : false;
[2]864
[56]865  Int lowestQP = - m_cSPS.getQpBDOffsetY();
866
867  if(getUseLossless())
[2]868  {
[56]869    if ((getMaxCuDQPDepth() == 0) && (getMaxDeltaQP() == 0 ) && (getQP() == lowestQP) )
870    {
871      bUseDQP = false;
872    }
873    else
874    {
875      bUseDQP = true;
876    }
[2]877  }
[56]878  else
879  {
880    if(bUseDQP == false)
881    {
882      if((getMaxDeltaQP() != 0 )|| getUseAdaptiveQP())
883      {
884        bUseDQP = true;
885      }
886    }
887  }
888
889  if(bUseDQP)
890  {
891    m_cPPS.setUseDQP(true);
892    m_cPPS.setMaxCuDQPDepth( m_iMaxCuDQPDepth );
893    m_cPPS.setMinCuDQPSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuDQPDepth()) );
894  }
895  else
896  {
897    m_cPPS.setUseDQP(false);
898    m_cPPS.setMaxCuDQPDepth( 0 );
899    m_cPPS.setMinCuDQPSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuDQPDepth()) );
900  }
[2]901
[608]902#if RATE_CONTROL_LAMBDA_DOMAIN
903  if ( m_RCEnableRateControl )
904  {
905    m_cPPS.setUseDQP(true);
906    m_cPPS.setMaxCuDQPDepth( 0 );
907    m_cPPS.setMinCuDQPSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuDQPDepth()) );
[655]908  }
909#endif
910#if !RATE_CONTROL_LAMBDA_DOMAIN && KWU_FIX_URQ
911  if ( m_enableRateCtrl )
912  {
913    m_cPPS.setUseDQP(true);
914    m_cPPS.setMaxCuDQPDepth( 0 );
915    m_cPPS.setMinCuDQPSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuDQPDepth()) );
[608]916  } 
917#endif
[2]918
[608]919  m_cPPS.setChromaCbQpOffset( m_chromaCbQpOffset );
920  m_cPPS.setChromaCrQpOffset( m_chromaCrQpOffset );
921
[56]922  m_cPPS.setNumSubstreams(m_iWaveFrontSubstreams);
[608]923  m_cPPS.setEntropyCodingSyncEnabledFlag( m_iWaveFrontSynchro > 0 );
924  m_cPPS.setTilesEnabledFlag( (m_iNumColumnsMinus1 > 0 || m_iNumRowsMinus1 > 0) );
925  m_cPPS.setUseWP( m_useWeightedPred );
926  m_cPPS.setWPBiPred( m_useWeightedBiPred );
[56]927  m_cPPS.setOutputFlagPresentFlag( false );
[608]928#if H_MV
[622]929  m_cPPS.setNumExtraSliceHeaderBits( 2 ); 
[608]930#endif
[56]931  m_cPPS.setSignHideFlag(getSignHideFlag());
[655]932  if ( getDeblockingFilterMetric() )
933  {
934    m_cPPS.setDeblockingFilterControlPresentFlag (true);
935    m_cPPS.setDeblockingFilterOverrideEnabledFlag(true);
936    m_cPPS.setPicDisableDeblockingFilterFlag(false);
937    m_cPPS.setDeblockingFilterBetaOffsetDiv2(0);
938    m_cPPS.setDeblockingFilterTcOffsetDiv2(0);
939  } 
940  else
941  {
942    m_cPPS.setDeblockingFilterControlPresentFlag (m_DeblockingFilterControlPresent );
943  }
[608]944  m_cPPS.setLog2ParallelMergeLevelMinus2   (m_log2ParallelMergeLevelMinus2 );
[56]945  m_cPPS.setCabacInitPresentFlag(CABAC_INIT_PRESENT_FLAG);
[608]946  m_cPPS.setLoopFilterAcrossSlicesEnabledFlag( m_bLFCrossSliceBoundaryFlag );
947  Int histogram[MAX_NUM_REF + 1];
948  for( Int i = 0; i <= MAX_NUM_REF; i++ )
949  {
950    histogram[i]=0;
951  }
952  for( Int i = 0; i < getGOPSize(); i++ )
953  {
954    assert(getGOPEntry(i).m_numRefPicsActive >= 0 && getGOPEntry(i).m_numRefPicsActive <= MAX_NUM_REF);
955    histogram[getGOPEntry(i).m_numRefPicsActive]++;
956  }
957  Int maxHist=-1;
958  Int bestPos=0;
959  for( Int i = 0; i <= MAX_NUM_REF; i++ )
960  {
961    if(histogram[i]>maxHist)
962    {
963      maxHist=histogram[i];
964      bestPos=i;
965    }
966  }
967  assert(bestPos <= 15);
968  m_cPPS.setNumRefIdxL0DefaultActive(bestPos);
969  m_cPPS.setNumRefIdxL1DefaultActive(bestPos);
970  m_cPPS.setTransquantBypassEnableFlag(getTransquantBypassEnableFlag());
971  m_cPPS.setUseTransformSkip( m_useTransformSkip );
972  if (m_sliceSegmentMode)
973  {
974    m_cPPS.setDependentSliceSegmentsEnabledFlag( true );
975  }
976  if( m_cPPS.getDependentSliceSegmentsEnabledFlag() )
977  {
978    Int NumCtx = m_cPPS.getEntropyCodingSyncEnabledFlag()?2:1;
979    m_cSliceEncoder.initCtxMem( NumCtx );
980    for ( UInt st = 0; st < NumCtx; st++ )
981    {
982      TEncSbac* ctx = NULL;
983      ctx = new TEncSbac;
984      ctx->init( &m_cBinCoderCABAC );
985      m_cSliceEncoder.setCtxMem( ctx, st );
986    }
987  }
988#if H_3D
989  if( m_cSPS.hasCamParInSliceHeader() )
990  {
991    m_cPPS.setSliceHeaderExtensionPresentFlag( true ); 
992  }
[42]993#endif
[2]994}
995
[56]996//Function for initializing m_RPSList, a list of TComReferencePictureSet, based on the GOPEntry objects read from the config file.
[655]997Void TEncTop::xInitRPS(Bool isFieldCoding)
[2]998{
[56]999  TComReferencePictureSet*      rps;
1000 
[655]1001  m_cSPS.createRPSList(getGOPSize()+m_extraRPSs+1);
[608]1002  TComRPSList* rpsList = m_cSPS.getRPSList();
1003
[56]1004  for( Int i = 0; i < getGOPSize()+m_extraRPSs; i++) 
1005  {
[608]1006    GOPEntry ge = getGOPEntry(i);
1007    rps = rpsList->getReferencePictureSet(i);
[56]1008    rps->setNumberOfPictures(ge.m_numRefPics);
1009    rps->setNumRefIdc(ge.m_numRefIdc);
1010    Int numNeg = 0;
1011    Int numPos = 0;
1012    for( Int j = 0; j < ge.m_numRefPics; j++)
[2]1013    {
[56]1014      rps->setDeltaPOC(j,ge.m_referencePics[j]);
1015      rps->setUsed(j,ge.m_usedByCurrPic[j]);
1016      if(ge.m_referencePics[j]>0)
1017      {
1018        numPos++;
1019      }
1020      else
1021      {
1022        numNeg++;
1023      }
[2]1024    }
[56]1025    rps->setNumberOfNegativePictures(numNeg);
1026    rps->setNumberOfPositivePictures(numPos);
[608]1027
1028    // handle inter RPS intialization from the config file.
1029#if AUTO_INTER_RPS
1030    rps->setInterRPSPrediction(ge.m_interRPSPrediction > 0);  // not very clean, converting anything > 0 to true.
1031    rps->setDeltaRIdxMinus1(0);                               // index to the Reference RPS is always the previous one.
1032    TComReferencePictureSet*     RPSRef = rpsList->getReferencePictureSet(i-1);  // get the reference RPS
1033
1034    if (ge.m_interRPSPrediction == 2)  // Automatic generation of the inter RPS idc based on the RIdx provided.
1035    {
1036      Int deltaRPS = getGOPEntry(i-1).m_POC - ge.m_POC;  // the ref POC - current POC
1037      Int numRefDeltaPOC = RPSRef->getNumberOfPictures();
1038
1039      rps->setDeltaRPS(deltaRPS);           // set delta RPS
1040      rps->setNumRefIdc(numRefDeltaPOC+1);  // set the numRefIdc to the number of pictures in the reference RPS + 1.
1041      Int count=0;
1042      for (Int j = 0; j <= numRefDeltaPOC; j++ ) // cycle through pics in reference RPS.
1043      {
1044        Int RefDeltaPOC = (j<numRefDeltaPOC)? RPSRef->getDeltaPOC(j): 0;  // if it is the last decoded picture, set RefDeltaPOC = 0
1045        rps->setRefIdc(j, 0);
1046        for (Int k = 0; k < rps->getNumberOfPictures(); k++ )  // cycle through pics in current RPS.
1047        {
1048          if (rps->getDeltaPOC(k) == ( RefDeltaPOC + deltaRPS))  // if the current RPS has a same picture as the reference RPS.
1049          {
1050              rps->setRefIdc(j, (rps->getUsed(k)?1:2));
1051              count++;
1052              break;
1053          }
1054        }
1055      }
1056      if (count != rps->getNumberOfPictures())
1057      {
1058        printf("Warning: Unable fully predict all delta POCs using the reference RPS index given in the config file.  Setting Inter RPS to false for this RPS.\n");
1059        rps->setInterRPSPrediction(0);
1060      }
1061    }
1062    else if (ge.m_interRPSPrediction == 1)  // inter RPS idc based on the RefIdc values provided in config file.
1063    {
1064      rps->setDeltaRPS(ge.m_deltaRPS);
1065      rps->setNumRefIdc(ge.m_numRefIdc);
1066      for (Int j = 0; j < ge.m_numRefIdc; j++ )
1067      {
1068        rps->setRefIdc(j, ge.m_refIdc[j]);
1069      }
1070#if WRITE_BACK
1071      // the folowing code overwrite the deltaPOC and Used by current values read from the config file with the ones
1072      // computed from the RefIdc.  A warning is printed if they are not identical.
1073      numNeg = 0;
1074      numPos = 0;
1075      TComReferencePictureSet      RPSTemp;  // temporary variable
1076
1077      for (Int j = 0; j < ge.m_numRefIdc; j++ )
1078      {
1079        if (ge.m_refIdc[j])
1080        {
1081          Int deltaPOC = ge.m_deltaRPS + ((j < RPSRef->getNumberOfPictures())? RPSRef->getDeltaPOC(j) : 0);
1082          RPSTemp.setDeltaPOC((numNeg+numPos),deltaPOC);
1083          RPSTemp.setUsed((numNeg+numPos),ge.m_refIdc[j]==1?1:0);
1084          if (deltaPOC<0)
1085          {
1086            numNeg++;
1087          }
1088          else
1089          {
1090            numPos++;
1091          }
1092        }
1093      }
1094      if (numNeg != rps->getNumberOfNegativePictures())
1095      {
1096        printf("Warning: number of negative pictures in RPS is different between intra and inter RPS specified in the config file.\n");
1097        rps->setNumberOfNegativePictures(numNeg);
[655]1098        rps->setNumberOfPictures(numNeg+numPos);
[608]1099      }
1100      if (numPos != rps->getNumberOfPositivePictures())
1101      {
1102        printf("Warning: number of positive pictures in RPS is different between intra and inter RPS specified in the config file.\n");
1103        rps->setNumberOfPositivePictures(numPos);
[655]1104        rps->setNumberOfPictures(numNeg+numPos);
[608]1105      }
1106      RPSTemp.setNumberOfPictures(numNeg+numPos);
1107      RPSTemp.setNumberOfNegativePictures(numNeg);
1108      RPSTemp.sortDeltaPOC();     // sort the created delta POC before comparing
1109      // check if Delta POC and Used are the same
1110      // print warning if they are not.
1111      for (Int j = 0; j < ge.m_numRefIdc; j++ )
1112      {
1113        if (RPSTemp.getDeltaPOC(j) != rps->getDeltaPOC(j))
1114        {
1115          printf("Warning: delta POC is different between intra RPS and inter RPS specified in the config file.\n");
1116          rps->setDeltaPOC(j,RPSTemp.getDeltaPOC(j));
1117        }
1118        if (RPSTemp.getUsed(j) != rps->getUsed(j))
1119        {
1120          printf("Warning: Used by Current in RPS is different between intra and inter RPS specified in the config file.\n");
1121          rps->setUsed(j,RPSTemp.getUsed(j));
1122        }
1123      }
1124#endif
1125    }
1126#else
[56]1127    rps->setInterRPSPrediction(ge.m_interRPSPrediction);
1128    if (ge.m_interRPSPrediction)
[2]1129    {
[608]1130      rps->setDeltaRIdxMinus1(0);
[56]1131      rps->setDeltaRPS(ge.m_deltaRPS);
1132      rps->setNumRefIdc(ge.m_numRefIdc);
1133      for (Int j = 0; j < ge.m_numRefIdc; j++ )
1134      {
1135        rps->setRefIdc(j, ge.m_refIdc[j]);
1136      }
1137#if WRITE_BACK
1138      // the folowing code overwrite the deltaPOC and Used by current values read from the config file with the ones
1139      // computed from the RefIdc.  This is not necessary if both are identical. Currently there is no check to see if they are identical.
1140      numNeg = 0;
1141      numPos = 0;
[608]1142      TComReferencePictureSet*     RPSRef = m_RPSList.getReferencePictureSet(i-1);
1143
[56]1144      for (Int j = 0; j < ge.m_numRefIdc; j++ )
1145      {
1146        if (ge.m_refIdc[j])
1147        {
1148          Int deltaPOC = ge.m_deltaRPS + ((j < RPSRef->getNumberOfPictures())? RPSRef->getDeltaPOC(j) : 0);
1149          rps->setDeltaPOC((numNeg+numPos),deltaPOC);
1150          rps->setUsed((numNeg+numPos),ge.m_refIdc[j]==1?1:0);
1151          if (deltaPOC<0)
1152          {
1153            numNeg++;
1154          }
1155          else
1156          {
1157            numPos++;
1158          }
1159        }
1160      }
1161      rps->setNumberOfNegativePictures(numNeg);
1162      rps->setNumberOfPositivePictures(numPos);
1163      rps->sortDeltaPOC();
1164#endif
[2]1165    }
[608]1166#endif //INTER_RPS_AUTO
[56]1167  }
[655]1168  //In case of field coding, we need to set special parameters for the first bottom field of the sequence, since it is not specified in the cfg file.
1169  //The position = GOPSize + extraRPSs which is (a priori) unused is reserved for this field in the RPS.
1170  if (isFieldCoding) 
1171  {
1172    rps = rpsList->getReferencePictureSet(getGOPSize()+m_extraRPSs);
1173    rps->setNumberOfPictures(1);
1174    rps->setNumberOfNegativePictures(1);
1175    rps->setNumberOfPositivePictures(0);
1176    rps->setNumberOfLongtermPictures(0);
1177    rps->setDeltaPOC(0,-1);
1178    rps->setPOC(0,0);
1179    rps->setUsed(0,true);
1180    rps->setInterRPSPrediction(false);
1181    rps->setDeltaRIdxMinus1(0);
1182    rps->setDeltaRPS(0);
1183    rps->setNumRefIdc(0);
[56]1184}
[655]1185}
[2]1186
[56]1187   // This is a function that
1188   // determines what Reference Picture Set to use
1189   // for a specific slice (with POC = POCCurr)
[608]1190Void TEncTop::selectReferencePictureSet(TComSlice* slice, Int POCCurr, Int GOPid )
[56]1191{
[608]1192#if H_MV
1193  if( slice->getRapPicFlag() == true && getLayerId() > 0 && POCCurr == 0 )
[56]1194  {
1195    TComReferencePictureSet* rps = slice->getLocalRPS();
1196    rps->setNumberOfNegativePictures(0);
1197    rps->setNumberOfPositivePictures(0);
1198    rps->setNumberOfLongtermPictures(0);
1199    rps->setNumberOfPictures(0);
1200    slice->setRPS(rps);
1201  }
1202  else
1203  {
[608]1204#endif
1205  slice->setRPSidx(GOPid);
[2]1206
[608]1207  for(Int extraNum=m_iGOPSize; extraNum<m_extraRPSs+m_iGOPSize; extraNum++)
1208  {   
1209    if(m_uiIntraPeriod > 0 && getDecodingRefreshType() > 0)
1210    {
1211      Int POCIndex = POCCurr%m_uiIntraPeriod;
1212      if(POCIndex == 0)
[56]1213      {
[608]1214        POCIndex = m_uiIntraPeriod;
[56]1215      }
[608]1216      if(POCIndex == m_GOPList[extraNum].m_POC)
[56]1217      {
[608]1218        slice->setRPSidx(extraNum);
[56]1219      }
1220    }
[608]1221    else
1222    {
1223      if(POCCurr==m_GOPList[extraNum].m_POC)
1224      {
1225        slice->setRPSidx(extraNum);
1226      }
1227    }
1228  }
[655]1229  if(POCCurr == 1 && slice->getPic()->isField())
1230  {
1231    slice->setRPSidx(m_iGOPSize+m_extraRPSs);
1232  }
[2]1233
[608]1234  slice->setRPS(getSPS()->getRPSList()->getReferencePictureSet(slice->getRPSidx()));
1235  slice->getRPS()->setNumberOfPictures(slice->getRPS()->getNumberOfNegativePictures()+slice->getRPS()->getNumberOfPositivePictures());
1236#if H_MV
[56]1237  }
[608]1238#endif
1239
[2]1240}
1241
[608]1242Int TEncTop::getReferencePictureSetIdxForSOP(TComSlice* slice, Int POCCurr, Int GOPid )
[2]1243{
[608]1244  int rpsIdx = GOPid;
[2]1245
[608]1246  for(Int extraNum=m_iGOPSize; extraNum<m_extraRPSs+m_iGOPSize; extraNum++)
1247  {   
1248    if(m_uiIntraPeriod > 0 && getDecodingRefreshType() > 0)
[2]1249    {
[608]1250      Int POCIndex = POCCurr%m_uiIntraPeriod;
1251      if(POCIndex == 0)
[2]1252      {
[608]1253        POCIndex = m_uiIntraPeriod;
[2]1254      }
[608]1255      if(POCIndex == m_GOPList[extraNum].m_POC)
[2]1256      {
[608]1257        rpsIdx = extraNum;
[2]1258      }
1259    }
[608]1260    else
[56]1261    {
[608]1262      if(POCCurr==m_GOPList[extraNum].m_POC)
[56]1263      {
[608]1264        rpsIdx = extraNum;
[56]1265      }
1266    }
[2]1267  }
[56]1268
[608]1269  return rpsIdx;
[56]1270}
1271
1272Void  TEncTop::xInitPPSforTiles()
1273{
[608]1274  m_cPPS.setUniformSpacingFlag( m_iUniformSpacingIdr );
1275  m_cPPS.setNumColumnsMinus1( m_iNumColumnsMinus1 );
1276  m_cPPS.setNumRowsMinus1( m_iNumRowsMinus1 );
1277  if( m_iUniformSpacingIdr == 0 )
1278  {
1279    m_cPPS.setColumnWidth( m_puiColumnWidth );
1280    m_cPPS.setRowHeight( m_puiRowHeight );
1281  }
1282  m_cPPS.setLoopFilterAcrossTilesEnabledFlag( m_loopFilterAcrossTilesEnabledFlag );
[56]1283
[608]1284  // # substreams is "per tile" when tiles are independent.
1285  if (m_iWaveFrontSynchro
1286    )
1287  {
1288    m_cPPS.setNumSubstreams(m_iWaveFrontSubstreams * (m_iNumColumnsMinus1+1));
1289  }
[2]1290}
1291
[56]1292Void  TEncCfg::xCheckGSParameters()
[2]1293{
[56]1294  Int   iWidthInCU = ( m_iSourceWidth%g_uiMaxCUWidth ) ? m_iSourceWidth/g_uiMaxCUWidth + 1 : m_iSourceWidth/g_uiMaxCUWidth;
1295  Int   iHeightInCU = ( m_iSourceHeight%g_uiMaxCUHeight ) ? m_iSourceHeight/g_uiMaxCUHeight + 1 : m_iSourceHeight/g_uiMaxCUHeight;
1296  UInt  uiCummulativeColumnWidth = 0;
1297  UInt  uiCummulativeRowHeight = 0;
1298
1299  //check the column relative parameters
1300  if( m_iNumColumnsMinus1 >= (1<<(LOG2_MAX_NUM_COLUMNS_MINUS1+1)) )
[2]1301  {
[56]1302    printf( "The number of columns is larger than the maximum allowed number of columns.\n" );
1303    exit( EXIT_FAILURE );
[2]1304  }
[56]1305
1306  if( m_iNumColumnsMinus1 >= iWidthInCU )
[2]1307  {
[56]1308    printf( "The current picture can not have so many columns.\n" );
1309    exit( EXIT_FAILURE );
[2]1310  }
[56]1311
1312  if( m_iNumColumnsMinus1 && m_iUniformSpacingIdr==0 )
[2]1313  {
[56]1314    for(Int i=0; i<m_iNumColumnsMinus1; i++)
[608]1315    {
[56]1316      uiCummulativeColumnWidth += m_puiColumnWidth[i];
[608]1317    }
[56]1318
1319    if( uiCummulativeColumnWidth >= iWidthInCU )
1320    {
1321      printf( "The width of the column is too large.\n" );
1322      exit( EXIT_FAILURE );
1323    }
[2]1324  }
[56]1325
1326  //check the row relative parameters
1327  if( m_iNumRowsMinus1 >= (1<<(LOG2_MAX_NUM_ROWS_MINUS1+1)) )
[2]1328  {
[56]1329    printf( "The number of rows is larger than the maximum allowed number of rows.\n" );
1330    exit( EXIT_FAILURE );
[2]1331  }
[56]1332
1333  if( m_iNumRowsMinus1 >= iHeightInCU )
[2]1334  {
[56]1335    printf( "The current picture can not have so many rows.\n" );
1336    exit( EXIT_FAILURE );
[2]1337  }
1338
[56]1339  if( m_iNumRowsMinus1 && m_iUniformSpacingIdr==0 )
1340  {
1341    for(Int i=0; i<m_iNumRowsMinus1; i++)
1342      uiCummulativeRowHeight += m_puiRowHeight[i];
1343
1344    if( uiCummulativeRowHeight >= iHeightInCU )
1345    {
1346      printf( "The height of the row is too large.\n" );
1347      exit( EXIT_FAILURE );
1348    }
1349  }
[2]1350}
[608]1351#if H_MV
[655]1352Void TEncTop::printSummary( Int numAllPicCoded, Bool isField )
[56]1353{
[655]1354  assert ( !isField ); // Multiview and field coding need to be further unified
[608]1355  assert (numAllPicCoded == m_cAnalyzeAll.getNumPic());
[2]1356
[56]1357  //--CFG_KDY
1358  m_cAnalyzeAll.setFrmRate( getFrameRate() );
1359  m_cAnalyzeI.setFrmRate( getFrameRate() );
1360  m_cAnalyzeP.setFrmRate( getFrameRate() );
1361  m_cAnalyzeB.setFrmRate( getFrameRate() );
[2]1362
[56]1363  //-- all
[608]1364  printf( "\n\nSUMMARY ------------------------------------------- LayerId %2d\n", m_layerId );
1365
[56]1366  m_cAnalyzeAll.printOut('a');
[2]1367
[56]1368  printf( "\n\nI Slices--------------------------------------------------------\n" );
1369  m_cAnalyzeI.printOut('i');
1370
1371  printf( "\n\nP Slices--------------------------------------------------------\n" );
1372  m_cAnalyzeP.printOut('p');
1373
1374  printf( "\n\nB Slices--------------------------------------------------------\n" );
1375  m_cAnalyzeB.printOut('b');
1376
[608]1377#if _SUMMARY_OUT_
1378  m_cAnalyzeAll.printSummaryOut();
1379#endif
1380#if _SUMMARY_PIC_
1381  m_cAnalyzeI.printSummary('I');
1382  m_cAnalyzeP.printSummary('P');
1383  m_cAnalyzeB.printSummary('B');
1384#endif
[2]1385}
[56]1386
[608]1387Int TEncTop::getFrameId(Int iGOPid) 
1388{
1389  if(m_iPOCLast == 0)
1390  {
1391    return(0 );
1392  }
1393  else
1394  {
1395    return m_iPOCLast -m_iNumPicRcvd+ getGOPEntry(iGOPid).m_POC ;
1396  }
1397}
1398
1399TComPic* TEncTop::getPic( Int poc )
1400{
1401  TComList<TComPic*>* listPic = getListPic();
1402  TComPic* pcPic = NULL;
1403  for(TComList<TComPic*>::iterator it=listPic->begin(); it!=listPic->end(); it++)
1404  {
1405    if( (*it)->getPOC() == poc )
1406    {
1407      pcPic = *it ;
1408      break ;
1409    }
1410  }
1411  return pcPic;
1412}
1413#endif
1414
1415#if H_3D_VSO
1416Void TEncTop::setupRenModel( Int iPoc, Int iEncViewIdx, Int iEncContent, Int iHorOffset )
1417{
1418  TRenModel* rendererModel = m_cRdCost.getRenModel(); 
1419  rendererModel->setupPart( iHorOffset, std::min( (Int) g_uiMaxCUHeight, (Int) ( m_iSourceHeight - iHorOffset ) )) ; 
1420 
1421  Int iEncViewSIdx = m_cameraParameters->getBaseId2SortedId()[ iEncViewIdx ];
1422
1423  // setup base views
1424  Int iNumOfBV = m_renderModelParameters->getNumOfBaseViewsForView( iEncViewSIdx, iEncContent );
1425
1426  for (Int iCurView = 0; iCurView < iNumOfBV; iCurView++ )
1427  {
1428    Int iBaseViewSIdx;
1429    Int iVideoDistMode;
1430    Int iDepthDistMode;
1431
1432    m_renderModelParameters->getBaseViewData( iEncViewSIdx, iEncContent, iCurView, iBaseViewSIdx, iVideoDistMode, iDepthDistMode );
1433
1434    AOT( iVideoDistMode < 0 || iVideoDistMode > 2 );
1435
1436    Int iBaseViewIdx = m_cameraParameters->getBaseSortedId2Id()[ iBaseViewSIdx ];
1437
1438    TComPicYuv* pcPicYuvVideoRec  = m_ivPicLists->getPicYuv( iBaseViewIdx, false, iPoc, true  );
1439    TComPicYuv* pcPicYuvDepthRec  = m_ivPicLists->getPicYuv( iBaseViewIdx, true , iPoc, true  );
1440    TComPicYuv* pcPicYuvVideoOrg  = m_ivPicLists->getPicYuv( iBaseViewIdx, false, iPoc, false );
1441    TComPicYuv* pcPicYuvDepthOrg  = m_ivPicLists->getPicYuv( iBaseViewIdx, true , iPoc, false );   
1442
1443    TComPicYuv* pcPicYuvVideoRef  = ( iVideoDistMode == 2 ) ? pcPicYuvVideoOrg  : NULL;
1444    TComPicYuv* pcPicYuvDepthRef  = ( iDepthDistMode == 2 ) ? pcPicYuvDepthOrg  : NULL;
1445
1446    TComPicYuv* pcPicYuvVideoTest = ( iVideoDistMode == 0 ) ? pcPicYuvVideoOrg  : pcPicYuvVideoRec;
1447    TComPicYuv* pcPicYuvDepthTest = ( iDepthDistMode == 0 ) ? pcPicYuvDepthOrg  : pcPicYuvDepthRec;
1448
1449    AOT( (iVideoDistMode == 2) != (pcPicYuvVideoRef != NULL) );
1450    AOT( (iDepthDistMode == 2) != (pcPicYuvDepthRef != NULL) );
1451    AOT( pcPicYuvDepthTest == NULL );
1452    AOT( pcPicYuvVideoTest == NULL );
1453
1454    rendererModel->setBaseView( iBaseViewSIdx, pcPicYuvVideoTest, pcPicYuvDepthTest, pcPicYuvVideoRef, pcPicYuvDepthRef );
1455  }
1456
1457  rendererModel->setErrorMode( iEncViewSIdx, iEncContent, 0 );
1458  // setup virtual views
1459  Int iNumOfSV  = m_renderModelParameters->getNumOfModelsForView( iEncViewSIdx, iEncContent );
1460  for (Int iCurView = 0; iCurView < iNumOfSV; iCurView++ )
1461  {
1462    Int iOrgRefBaseViewSIdx;
1463    Int iLeftBaseViewSIdx;
1464    Int iRightBaseViewSIdx;
1465    Int iSynthViewRelNum;
1466    Int iModelNum;
1467    Int iBlendMode;
1468    m_renderModelParameters->getSingleModelData(iEncViewSIdx, iEncContent, iCurView, iModelNum, iBlendMode,iLeftBaseViewSIdx, iRightBaseViewSIdx, iOrgRefBaseViewSIdx, iSynthViewRelNum );
1469
1470    Int iLeftBaseViewIdx    = -1;
1471    Int iRightBaseViewIdx   = -1;
1472
1473    TComPicYuv* pcPicYuvOrgRef  = NULL;
1474    Int**      ppiShiftLUTLeft  = NULL;
1475    Int**      ppiShiftLUTRight = NULL;
1476    Int**      ppiBaseShiftLUTLeft  = NULL;
1477    Int**      ppiBaseShiftLUTRight = NULL;
1478
1479
1480    Int        iDistToLeft      = -1;
1481
1482    Int iSynthViewIdx = m_cameraParameters->synthRelNum2Idx( iSynthViewRelNum );
1483
1484    if ( iLeftBaseViewSIdx != -1 )
1485    {
1486      iLeftBaseViewIdx   = m_cameraParameters->getBaseSortedId2Id()   [ iLeftBaseViewSIdx ];
1487      ppiShiftLUTLeft    = m_cameraParameters->getSynthViewShiftLUTI()[ iLeftBaseViewIdx  ][ iSynthViewIdx  ];
1488    }
1489
1490    if ( iRightBaseViewSIdx != -1 )
1491    {
1492      iRightBaseViewIdx  = m_cameraParameters->getBaseSortedId2Id()   [iRightBaseViewSIdx ];
1493      ppiShiftLUTRight   = m_cameraParameters->getSynthViewShiftLUTI()[ iRightBaseViewIdx ][ iSynthViewIdx ];
1494    }
1495
1496    if ( iRightBaseViewSIdx != -1 && iLeftBaseViewSIdx != -1 )
1497    {
1498      iDistToLeft          = m_cameraParameters->getRelDistLeft(  iSynthViewIdx , iLeftBaseViewIdx, iRightBaseViewIdx);
1499      ppiBaseShiftLUTLeft  = m_cameraParameters->getBaseViewShiftLUTI() [ iLeftBaseViewIdx  ][ iRightBaseViewIdx ];
1500      ppiBaseShiftLUTRight = m_cameraParameters->getBaseViewShiftLUTI() [ iRightBaseViewIdx ][ iLeftBaseViewIdx  ];
1501
1502    }
1503
1504    if ( iOrgRefBaseViewSIdx != -1 )
1505    {
1506      pcPicYuvOrgRef = m_ivPicLists->getPicYuv(  m_cameraParameters->getBaseSortedId2Id()[ iOrgRefBaseViewSIdx ] , false, iPoc, false );
1507      AOF ( pcPicYuvOrgRef );
1508    }
1509
1510    rendererModel->setSingleModel( iModelNum, ppiShiftLUTLeft, ppiBaseShiftLUTLeft, ppiShiftLUTRight, ppiBaseShiftLUTRight, iDistToLeft, pcPicYuvOrgRef );
1511  }
1512}
1513#endif
[56]1514//! \}
Note: See TracBrowser for help on using the repository browser.