source: 3DVCSoftware/branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp @ 876

Last change on this file since 876 was 876, checked in by tech, 10 years ago

Cleanups part 1.

  • Property svn:eol-style set to native
File size: 33.5 KB
Line 
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-2014, ITU/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 ITU/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 */
33
34/** \file     TDecEntropy.cpp
35    \brief    entropy decoder class
36*/
37
38#include "TDecEntropy.h"
39
40//! \ingroup TLibDecoder
41//! \{
42
43Void TDecEntropy::setEntropyDecoder         ( TDecEntropyIf* p )
44{
45  m_pcEntropyDecoderIf = p;
46}
47
48#include "TLibCommon/TComSampleAdaptiveOffset.h"
49
50Void TDecEntropy::decodeSkipFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
51{
52  m_pcEntropyDecoderIf->parseSkipFlag( pcCU, uiAbsPartIdx, uiDepth );
53}
54
55Void TDecEntropy::decodeCUTransquantBypassFlag(TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
56{
57  m_pcEntropyDecoderIf->parseCUTransquantBypassFlag( pcCU, uiAbsPartIdx, uiDepth );
58}
59
60/** decode merge flag
61 * \param pcSubCU
62 * \param uiAbsPartIdx
63 * \param uiDepth
64 * \param uiPUIdx
65 * \returns Void
66 */
67Void TDecEntropy::decodeMergeFlag( TComDataCU* pcSubCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx )
68{ 
69  // at least one merge candidate exists
70  m_pcEntropyDecoderIf->parseMergeFlag( pcSubCU, uiAbsPartIdx, uiDepth, uiPUIdx );
71}
72
73/** decode merge index
74 * \param pcCU
75 * \param uiPartIdx
76 * \param uiAbsPartIdx
77 * \param puhInterDirNeighbours pointer to list of inter direction from the casual neighbours
78 * \param pcMvFieldNeighbours pointer to list of motion vector field from the casual neighbours
79 * \param uiDepth
80 * \returns Void
81 */
82Void TDecEntropy::decodeMergeIndex( TComDataCU* pcCU, UInt uiPartIdx, UInt uiAbsPartIdx, UInt uiDepth )
83{
84  UInt uiMergeIndex = 0;
85  m_pcEntropyDecoderIf->parseMergeIndex( pcCU, uiMergeIndex );
86  pcCU->setMergeIndexSubParts( uiMergeIndex, uiAbsPartIdx, uiPartIdx, uiDepth );
87}
88
89#if H_3D_ARP
90Void TDecEntropy::decodeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
91{
92  if( !pcCU->getSlice()->getARPStepNum() || pcCU->isIntra( uiAbsPartIdx ) )
93  {
94    return;
95  }
96
97  if( pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N )
98  {
99    pcCU->setARPWSubParts( 0 , uiAbsPartIdx, uiDepth );
100  }
101  else
102  {
103    m_pcEntropyDecoderIf->parseARPW( pcCU , uiAbsPartIdx , uiDepth );
104  }
105}
106#endif
107
108#if H_3D_IC
109Void TDecEntropy::decodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
110{
111  pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth );
112
113  if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() || pcCU->getARPW( uiAbsPartIdx ) > 0 )
114  {
115    return;
116  }
117
118  if( !pcCU->getSlice()->getApplyIC() )
119    return;
120
121  if( pcCU->isICFlagRequired( uiAbsPartIdx ) )
122    m_pcEntropyDecoderIf->parseICFlag( pcCU, uiAbsPartIdx, uiDepth );
123}
124#endif
125
126Void TDecEntropy::decodeSplitFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
127{
128  m_pcEntropyDecoderIf->parseSplitFlag( pcCU, uiAbsPartIdx, uiDepth );
129}
130
131Void TDecEntropy::decodePredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
132{
133  m_pcEntropyDecoderIf->parsePredMode( pcCU, uiAbsPartIdx, uiDepth );
134}
135
136Void TDecEntropy::decodePartSize( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
137{
138  m_pcEntropyDecoderIf->parsePartSize( pcCU, uiAbsPartIdx, uiDepth );
139 
140#if H_3D_DBBP
141  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && pcCU->getPartitionSize(uiAbsPartIdx) == RWTH_DBBP_PACK_MODE )
142  {
143    decodeDBBPFlag(pcCU, uiAbsPartIdx, uiDepth);
144   
145    if( pcCU->getDBBPFlag(uiAbsPartIdx) )
146    {
147      AOF( pcCU->getPartitionSize(uiAbsPartIdx) == RWTH_DBBP_PACK_MODE );
148     
149      // get collocated depth block
150      UInt uiDepthStride = 0;
151      Pel* pDepthPels = NULL;
152      pDepthPels = pcCU->getVirtualDepthBlock(uiAbsPartIdx, pcCU->getWidth(uiAbsPartIdx), pcCU->getHeight(uiAbsPartIdx), uiDepthStride);
153     
154      AOF( pDepthPels != NULL );
155      AOF( uiDepthStride != 0 );
156     
157      // derive true partitioning for this CU based on depth
158      // (needs to be done in parsing process as motion vector predictors are also derived during parsing)
159      PartSize eVirtualPartSize = m_pcPrediction->getPartitionSizeFromDepth(pDepthPels, uiDepthStride, pcCU->getWidth(uiAbsPartIdx));
160      AOF( eVirtualPartSize != SIZE_NONE );
161     
162      pcCU->setPartSizeSubParts(eVirtualPartSize, uiAbsPartIdx, uiDepth);
163    }
164  }
165#endif
166}
167
168Void TDecEntropy::decodePredInfo    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU )
169{
170  if( pcCU->isIntra( uiAbsPartIdx ) )                                 // If it is Intra mode, encode intra prediction mode.
171  {
172    decodeIntraDirModeLuma  ( pcCU, uiAbsPartIdx, uiDepth );
173#if H_3D_DIM_SDC
174    if(!pcCU->getSDCFlag(uiAbsPartIdx))
175#endif
176    decodeIntraDirModeChroma( pcCU, uiAbsPartIdx, uiDepth );
177  }
178  else                                                                // if it is Inter mode, encode motion vector and reference index
179  {
180    decodePUWise( pcCU, uiAbsPartIdx, uiDepth, pcSubCU );
181  }
182}
183
184/** Parse I_PCM information.
185 * \param pcCU  pointer to CUpointer to CU
186 * \param uiAbsPartIdx CU index
187 * \param uiDepth CU depth
188 * \returns Void
189 */
190Void TDecEntropy::decodeIPCMInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
191{
192  if(!pcCU->getSlice()->getSPS()->getUsePCM()
193    || pcCU->getWidth(uiAbsPartIdx) > (1<<pcCU->getSlice()->getSPS()->getPCMLog2MaxSize())
194    || pcCU->getWidth(uiAbsPartIdx) < (1<<pcCU->getSlice()->getSPS()->getPCMLog2MinSize()) )
195  {
196    return;
197  }
198#if H_3D_DIM_SDC
199  if( pcCU->getSDCFlag(uiAbsPartIdx) )
200  {
201    return;
202  }
203#endif
204 
205  m_pcEntropyDecoderIf->parseIPCMInfo( pcCU, uiAbsPartIdx, uiDepth );
206}
207
208Void TDecEntropy::decodeIntraDirModeLuma  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
209{
210  m_pcEntropyDecoderIf->parseIntraDirLumaAng( pcCU, uiAbsPartIdx, uiDepth );
211}
212
213Void TDecEntropy::decodeIntraDirModeChroma( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
214{
215  m_pcEntropyDecoderIf->parseIntraDirChroma( pcCU, uiAbsPartIdx, uiDepth );
216}
217
218/** decode motion information for every PU block.
219 * \param pcCU
220 * \param uiAbsPartIdx
221 * \param uiDepth
222 * \param pcSubCU
223 * \returns Void
224 */
225Void TDecEntropy::decodePUWise( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU )
226{
227  PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
228  UInt uiNumPU = ( ePartSize == SIZE_2Nx2N ? 1 : ( ePartSize == SIZE_NxN ? 4 : 2 ) );
229  UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxCUDepth() - uiDepth ) << 1 ) ) >> 4;
230
231#if H_3D_IV_MERGE
232  TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists
233  UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];
234#else
235  TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists
236  UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS];
237#endif
238#if H_3D_SPIVMP
239  Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM];
240  TComMvField*  pcMvFieldSP;
241  UChar* puhInterDirSP;
242  pcMvFieldSP = new TComMvField[pcCU->getPic()->getPicSym()->getNumPartition()*2]; 
243  puhInterDirSP = new UChar[pcCU->getPic()->getPicSym()->getNumPartition()]; 
244#endif
245  for ( UInt ui = 0; ui < pcCU->getSlice()->getMaxNumMergeCand(); ui++ )
246  {
247    uhInterDirNeighbours[ui] = 0;
248  }
249  Int numValidMergeCand = 0;
250  Bool isMerged = false;
251
252  pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 );
253  pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 );
254#if H_3D_IV_MERGE
255  pcSubCU->copyDVInfoFrom( pcCU, uiAbsPartIdx);
256#endif
257  for ( UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset )
258  {
259#if H_MV_ENC_DEC_TRAC
260    DTRACE_PU_S("=========== prediction_unit ===========\n")
261    // ToDo:
262    //DTRACE_PU("x0", uiLPelX)
263    //DTRACE_PU("x1", uiTPelY)
264#endif
265    decodeMergeFlag( pcCU, uiSubPartIdx, uiDepth, uiPartIdx );
266    if ( pcCU->getMergeFlag( uiSubPartIdx ) )
267    {
268      decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, uiDepth );
269      UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);
270#if H_3D_ARP
271      decodeARPW  ( pcCU, uiAbsPartIdx, uiDepth );
272#endif
273#if H_3D_IC
274      decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
275#endif
276#if H_3D_DBBP
277      if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 && pcCU->getDBBPFlag(uiAbsPartIdx) == false )
278#else
279      if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 ) 
280#endif
281      {
282        pcSubCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );
283        if ( !isMerged )
284        {
285#if H_3D_VSP
286          Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
287          memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
288          InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
289#if H_3D_SPIVMP
290          memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
291#endif
292          pcSubCU->initAvailableFlags();
293          pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);
294          pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo
295#if H_3D_SPIVMP
296            , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP
297#endif
298            , numValidMergeCand );
299          pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
300
301          if(vspFlag[uiMergeIndex])
302          {
303            pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeIndex].m_acDvInfo, uiSubPartIdx, uiPartIdx, uiDepth);
304          }
305#else
306#if H_3D
307          pcSubCU->initAvailableFlags();
308          pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);
309          pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
310
311#else
312          pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
313#endif
314#endif
315          isMerged = true;
316        }
317        pcSubCU->setPartSizeSubParts( ePartSize, 0, uiDepth );
318      }
319      else
320      {
321        uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);
322#if H_3D_VSP
323        Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
324        memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
325        InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
326#if H_3D_SPIVMP
327        memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
328#endif
329        pcSubCU->initAvailableFlags();
330        pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
331        pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo
332#if H_3D_SPIVMP
333          , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP
334#endif
335          ,numValidMergeCand, uiMergeIndex );
336        pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
337        if(vspFlag[uiMergeIndex])
338        {
339          pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeIndex].m_acDvInfo, uiSubPartIdx, uiPartIdx, uiDepth);
340        }
341#else
342#if H_3D
343        pcSubCU->initAvailableFlags();
344        pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
345        pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
346#else
347        pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
348#endif
349#endif
350      }
351      pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
352
353#if MTK_DDD_G0063
354      if( uiMergeIndex == pcSubCU->getUseDDDCandIdx() )
355      {
356          assert( pcCU->getSlice()->getViewIndex() != 0 );
357          pcCU->setUseDDD( true, uiSubPartIdx, uiPartIdx, uiDepth );
358          pcCU->setDDDepthSubParts( pcSubCU->getDDTmpDepth(),uiSubPartIdx, uiPartIdx, uiDepth );
359      }
360      else
361      {
362          pcCU->setUseDDD( false, uiSubPartIdx, uiPartIdx, uiDepth );
363      }
364#endif
365
366      TComMv cTmpMv( 0, 0 );
367      for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
368      {       
369        if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 )
370        {
371          pcCU->setMVPIdxSubParts( 0, RefPicList( uiRefListIdx ), uiSubPartIdx, uiPartIdx, uiDepth);
372          pcCU->setMVPNumSubParts( 0, RefPicList( uiRefListIdx ), uiSubPartIdx, uiPartIdx, uiDepth);
373          pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx );
374          pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx );
375#if NTT_STORE_SPDV_VSP_G0148
376#if H_3D_DBBP
377          if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 && !pcCU->getDBBPFlag( uiAbsPartIdx ) )
378#else
379          if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 )
380#endif
381          {
382            if ( uhInterDirNeighbours[ uiMergeIndex ] & (1<<uiRefListIdx) )
383            {
384              UInt dummy;
385              Int vspSize;
386              Int width, height;
387              pcCU->getPartIndexAndSize( uiPartIdx, dummy, width, height, uiSubPartIdx, pcCU->getTotalNumPart()==256 );
388              pcCU->setMvFieldPUForVSP( pcCU, uiSubPartIdx, width, height, RefPicList( uiRefListIdx ), cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getRefIdx(), vspSize );
389              pcCU->setVSPFlag( uiSubPartIdx, vspSize );
390            }
391          }
392#endif
393        }
394      }
395#if H_3D_SPIVMP
396      pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 
397      if (bSPIVMPFlag[uiMergeIndex] != 0)
398      {
399        Int iWidth, iHeight;
400        UInt uiIdx;
401        pcCU->getPartIndexAndSize( uiPartIdx, uiIdx, iWidth, iHeight, uiSubPartIdx, true );
402
403        UInt uiSPAddr;
404
405        Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;
406
407        pcCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight);
408
409        for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++)
410        {
411          pcCU->getSPAbsPartIdx(uiSubPartIdx, iSPWidth, iSPHeight, iPartitionIdx, iNumSPInOneLine, uiSPAddr);
412          pcCU->setInterDirSP(puhInterDirSP[iPartitionIdx], uiSPAddr, iSPWidth, iSPHeight);
413          pcCU->getCUMvField( REF_PIC_LIST_0 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx], iSPWidth, iSPHeight);
414          pcCU->getCUMvField( REF_PIC_LIST_1 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx + 1], iSPWidth, iSPHeight);
415        }
416      }
417#endif
418    }
419    else
420    {
421      decodeInterDirPU( pcCU, uiSubPartIdx, uiDepth, uiPartIdx );
422      for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
423      {       
424        if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 )
425        {
426          decodeRefFrmIdxPU( pcCU,    uiSubPartIdx,              uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) );
427          decodeMvdPU      ( pcCU,    uiSubPartIdx,              uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) );
428          decodeMVPIdxPU   ( pcSubCU, uiSubPartIdx-uiAbsPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) );
429        }
430      }
431#if H_3D_ARP
432      decodeARPW  ( pcCU, uiAbsPartIdx, uiDepth );
433#endif
434#if H_3D_IC
435      decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
436#endif
437    }
438#if H_3D_VSP
439#if NTT_STORE_SPDV_VSP_G0148
440    if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) && (pcCU->getVSPFlag(uiSubPartIdx) == 0))
441#else
442    if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) && (pcCU->getVSPFlag(uiSubPartIdx) == false))
443#endif
444#else
445    if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) )
446#endif
447    {
448      pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMv( TComMv(0,0), ePartSize, uiSubPartIdx, uiDepth, uiPartIdx);
449      pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllRefIdx( -1, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx);
450      pcCU->setInterDirSubParts( 1, uiSubPartIdx, uiPartIdx, uiDepth);
451    }
452  }
453#if H_3D_SPIVMP
454  delete[] pcMvFieldSP;
455  delete[] puhInterDirSP;
456#endif
457  return;
458}
459
460/** decode inter direction for a PU block
461 * \param pcCU
462 * \param uiAbsPartIdx
463 * \param uiDepth
464 * \param uiPartIdx
465 * \returns Void
466 */
467Void TDecEntropy::decodeInterDirPU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx )
468{
469  UInt uiInterDir;
470
471  if ( pcCU->getSlice()->isInterP() )
472  {
473    uiInterDir = 1;
474  }
475  else
476  {
477    m_pcEntropyDecoderIf->parseInterDir( pcCU, uiInterDir, uiAbsPartIdx );
478  }
479
480  pcCU->setInterDirSubParts( uiInterDir, uiAbsPartIdx, uiPartIdx, uiDepth );
481}
482
483Void TDecEntropy::decodeRefFrmIdxPU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList )
484{
485  Int iRefFrmIdx = 0;
486  Int iParseRefFrmIdx = pcCU->getInterDir( uiAbsPartIdx ) & ( 1 << eRefList );
487
488  if ( pcCU->getSlice()->getNumRefIdx( eRefList ) > 1 && iParseRefFrmIdx )
489  {
490    m_pcEntropyDecoderIf->parseRefFrmIdx( pcCU, iRefFrmIdx, eRefList );
491  }
492  else if ( !iParseRefFrmIdx )
493  {
494    iRefFrmIdx = NOT_VALID;
495  }
496  else
497  {
498    iRefFrmIdx = 0;
499  }
500
501  PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
502  pcCU->getCUMvField( eRefList )->setAllRefIdx( iRefFrmIdx, ePartSize, uiAbsPartIdx, uiDepth, uiPartIdx );
503}
504
505/** decode motion vector difference for a PU block
506 * \param pcCU
507 * \param uiAbsPartIdx
508 * \param uiDepth
509 * \param uiPartIdx
510 * \param eRefList
511 * \returns Void
512 */
513Void TDecEntropy::decodeMvdPU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList )
514{
515  if ( pcCU->getInterDir( uiAbsPartIdx ) & ( 1 << eRefList ) )
516  {
517    m_pcEntropyDecoderIf->parseMvd( pcCU, uiAbsPartIdx, uiPartIdx, uiDepth, eRefList );
518  }
519}
520
521Void TDecEntropy::decodeMVPIdxPU( TComDataCU* pcSubCU, UInt uiPartAddr, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList )
522{
523  Int iMVPIdx = -1;
524
525  TComMv cZeroMv( 0, 0 );
526  TComMv cMv     = cZeroMv;
527  Int    iRefIdx = -1;
528
529  TComCUMvField* pcSubCUMvField = pcSubCU->getCUMvField( eRefList );
530  AMVPInfo* pAMVPInfo = pcSubCUMvField->getAMVPInfo();
531
532  iRefIdx = pcSubCUMvField->getRefIdx(uiPartAddr);
533  cMv = cZeroMv;
534
535  if ( (pcSubCU->getInterDir(uiPartAddr) & ( 1 << eRefList )) )
536  {
537    m_pcEntropyDecoderIf->parseMVPIdx( iMVPIdx );
538#if H_MV_ENC_DEC_TRAC
539#if ENC_DEC_TRACE
540    if ( eRefList == REF_PIC_LIST_0 )
541    {
542      DTRACE_PU("mvp_l0_flag", iMVPIdx)
543    }
544    else
545    {
546      DTRACE_PU("mvp_l1_flag", iMVPIdx)
547    }
548#endif
549#endif
550  }
551  pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo);
552  pcSubCU->setMVPNumSubParts(pAMVPInfo->iN, eRefList, uiPartAddr, uiPartIdx, uiDepth);
553  pcSubCU->setMVPIdxSubParts( iMVPIdx, eRefList, uiPartAddr, uiPartIdx, uiDepth );
554  if ( iRefIdx >= 0 )
555  {
556    m_pcPrediction->getMvPredAMVP( pcSubCU, uiPartIdx, uiPartAddr, eRefList, cMv);
557    cMv += pcSubCUMvField->getMvd( uiPartAddr );
558  }
559
560  PartSize ePartSize = pcSubCU->getPartitionSize( uiPartAddr );
561  pcSubCU->getCUMvField( eRefList )->setAllMv(cMv, ePartSize, uiPartAddr, 0, uiPartIdx);
562}
563
564Void TDecEntropy::xDecodeTransform( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP, Int quadtreeTULog2MinSizeInCU)
565{
566  UInt uiSubdiv;
567  const UInt uiLog2TrafoSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()]+2 - uiDepth;
568
569  if(uiTrIdx==0)
570  {
571    m_bakAbsPartIdxCU = uiAbsPartIdx;
572  }
573  if( uiLog2TrafoSize == 2 )
574  {
575    UInt partNum = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 );
576    if( ( uiAbsPartIdx % partNum ) == 0 )
577    {
578      m_uiBakAbsPartIdx   = uiAbsPartIdx;
579      m_uiBakChromaOffset = offsetChroma;
580    }
581  }
582  if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTRA && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_NxN && uiDepth == pcCU->getDepth(uiAbsPartIdx) )
583  {
584    uiSubdiv = 1;
585  }
586  else if( (pcCU->getSlice()->getSPS()->getQuadtreeTUMaxDepthInter() == 1) && (pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER) && ( pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N ) && (uiDepth == pcCU->getDepth(uiAbsPartIdx)) )
587  {
588    uiSubdiv = (uiLog2TrafoSize > quadtreeTULog2MinSizeInCU);
589  }
590  else if( uiLog2TrafoSize > pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() )
591  {
592    uiSubdiv = 1;
593  }
594  else if( uiLog2TrafoSize == pcCU->getSlice()->getSPS()->getQuadtreeTULog2MinSize() )
595  {
596    uiSubdiv = 0;
597  }
598  else if( uiLog2TrafoSize == quadtreeTULog2MinSizeInCU )
599  {
600    uiSubdiv = 0;
601  }
602  else
603  {
604    assert( uiLog2TrafoSize > quadtreeTULog2MinSizeInCU );
605    m_pcEntropyDecoderIf->parseTransformSubdivFlag( uiSubdiv, 5 - uiLog2TrafoSize );
606  }
607 
608  const UInt uiTrDepth = uiDepth - pcCU->getDepth( uiAbsPartIdx );
609  {
610    const Bool bFirstCbfOfCU = uiTrDepth == 0;
611    if( bFirstCbfOfCU )
612    {
613      pcCU->setCbfSubParts( 0, TEXT_CHROMA_U, uiAbsPartIdx, uiDepth );
614      pcCU->setCbfSubParts( 0, TEXT_CHROMA_V, uiAbsPartIdx, uiDepth );
615    }
616    if( bFirstCbfOfCU || uiLog2TrafoSize > 2 )
617    {
618      if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) )
619      {
620        m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth, uiDepth );
621      }
622      if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth - 1 ) )
623      {
624        m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth, uiDepth );
625      }
626    }
627    else
628    {
629      pcCU->setCbfSubParts( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) << uiTrDepth, TEXT_CHROMA_U, uiAbsPartIdx, uiDepth );
630      pcCU->setCbfSubParts( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth - 1 ) << uiTrDepth, TEXT_CHROMA_V, uiAbsPartIdx, uiDepth );
631    }
632  }
633 
634  if( uiSubdiv )
635  {
636    UInt size;
637    width  >>= 1;
638    height >>= 1;
639    size = width*height;
640    uiTrIdx++;
641    ++uiDepth;
642    const UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1);
643    const UInt uiStartAbsPartIdx = uiAbsPartIdx;
644    UInt uiYCbf = 0;
645    UInt uiUCbf = 0;
646    UInt uiVCbf = 0;
647   
648    for( Int i = 0; i < 4; i++ )
649    {
650      xDecodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP, quadtreeTULog2MinSizeInCU );
651      uiYCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrDepth+1 );
652      uiUCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth+1 );
653      uiVCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth+1 );
654      uiAbsPartIdx += uiQPartNum;
655      offsetLuma += size;  offsetChroma += (size>>2);
656    }
657   
658    for( UInt ui = 0; ui < 4 * uiQPartNum; ++ui )
659    {
660      pcCU->getCbf( TEXT_LUMA     )[uiStartAbsPartIdx + ui] |= uiYCbf << uiTrDepth;
661      pcCU->getCbf( TEXT_CHROMA_U )[uiStartAbsPartIdx + ui] |= uiUCbf << uiTrDepth;
662      pcCU->getCbf( TEXT_CHROMA_V )[uiStartAbsPartIdx + ui] |= uiVCbf << uiTrDepth;
663    }
664  }
665  else
666  {
667    assert( uiDepth >= pcCU->getDepth( uiAbsPartIdx ) );
668    pcCU->setTrIdxSubParts( uiTrDepth, uiAbsPartIdx, uiDepth );
669   
670#if !H_MV_ENC_DEC_TRAC
671    {
672      DTRACE_CABAC_VL( g_nSymbolCounter++ );
673      DTRACE_CABAC_T( "\tTrIdx: abspart=" );
674      DTRACE_CABAC_V( uiAbsPartIdx );
675      DTRACE_CABAC_T( "\tdepth=" );
676      DTRACE_CABAC_V( uiDepth );
677      DTRACE_CABAC_T( "\ttrdepth=" );
678      DTRACE_CABAC_V( uiTrDepth );
679      DTRACE_CABAC_T( "\n" );
680    }
681#endif
682   
683    pcCU->setCbfSubParts ( 0, TEXT_LUMA, uiAbsPartIdx, uiDepth );
684    if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) )
685    {
686      pcCU->setCbfSubParts( 1 << uiTrDepth, TEXT_LUMA, uiAbsPartIdx, uiDepth );
687    }
688    else
689    {
690      m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_LUMA, uiTrDepth, uiDepth );
691    }
692
693
694    // transform_unit begin
695    UInt cbfY = pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA    , uiTrIdx );
696    UInt cbfU = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx );
697    UInt cbfV = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx );
698    if( uiLog2TrafoSize == 2 )
699    {
700      UInt partNum = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 );
701      if( ( uiAbsPartIdx % partNum ) == (partNum - 1) )
702      {
703        cbfU = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx );
704        cbfV = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx );
705      }
706    }
707    if ( cbfY || cbfU || cbfV )
708    {
709      // dQP: only for LCU
710      if ( pcCU->getSlice()->getPPS()->getUseDQP() )
711      {
712        if ( bCodeDQP )
713        {
714          decodeQP( pcCU, m_bakAbsPartIdxCU);
715          bCodeDQP = false;
716        }
717      }
718    }
719    if( cbfY )
720    {
721      Int trWidth = width;
722      Int trHeight = height;
723      m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffY()+offsetLuma), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_LUMA );
724    }
725    if( uiLog2TrafoSize > 2 )
726    {
727      Int trWidth = width >> 1;
728      Int trHeight = height >> 1;
729      if( cbfU )
730      {
731        m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCb()+offsetChroma), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U );
732      }
733      if( cbfV )
734      {
735        m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCr()+offsetChroma), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V );
736      }
737    }
738    else
739    {
740      UInt partNum = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 );
741      if( ( uiAbsPartIdx % partNum ) == (partNum - 1) )
742      {
743        Int trWidth = width;
744        Int trHeight = height;
745        if( cbfU )
746        {
747          m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCb()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U );
748        }
749        if( cbfV )
750        {
751          m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCr()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V );
752        }
753      }
754    }
755    // transform_unit end
756  }
757}
758
759Void TDecEntropy::decodeQP          ( TComDataCU* pcCU, UInt uiAbsPartIdx )
760{
761  if ( pcCU->getSlice()->getPPS()->getUseDQP() )
762  {
763    m_pcEntropyDecoderIf->parseDeltaQP( pcCU, uiAbsPartIdx, pcCU->getDepth( uiAbsPartIdx ) );
764  }
765}
766
767
768/** decode coefficients
769 * \param pcCU
770 * \param uiAbsPartIdx
771 * \param uiDepth
772 * \param uiWidth
773 * \param uiHeight
774 * \returns Void
775 */
776Void TDecEntropy::decodeCoeff( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP )
777{
778  UInt uiMinCoeffSize = pcCU->getPic()->getMinCUWidth()*pcCU->getPic()->getMinCUHeight();
779  UInt uiLumaOffset   = uiMinCoeffSize*uiAbsPartIdx;
780  UInt uiChromaOffset = uiLumaOffset>>2;
781#if QC_SDC_UNIFY_G0130
782#if H_3D_DIM_SDC
783  if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx) )
784  {
785    assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
786    assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
787    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
788    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
789    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
790  }
791#endif
792
793#if H_3D_INTER_SDC
794  if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx) )
795  {
796    assert( !pcCU->isSkipped( uiAbsPartIdx ) );
797    assert( !pcCU->isIntra( uiAbsPartIdx) );
798    assert( pcCU->getSlice()->getIsDepth() );
799  }
800#endif
801#if QC_SDC_UNIFY_G0130_FIX
802  if( pcCU->getSlice()->getIsDepth() && ( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) ) )
803#else
804  if( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) )
805#endif
806  {
807    Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1;
808    UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2;
809 
810    if( !pcCU->getSDCFlag( uiAbsPartIdx ) )
811    {
812      for( Int iPart = 0; iPart < iPartNum; iPart++ )
813      {
814        if( getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx + uiPartOffset*iPart ) ) < DIM_NUM_TYPE ) 
815        {
816          m_pcEntropyDecoderIf->parseDeltaDC( pcCU, uiAbsPartIdx + uiPartOffset*iPart, uiDepth + ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) );
817        }
818      }
819    }
820    else
821    {
822      m_pcEntropyDecoderIf->parseDeltaDC( pcCU, uiAbsPartIdx, uiDepth );
823      return;
824    }
825  }
826#else
827#if H_3D_DIM_SDC
828  if( pcCU->getSDCFlag( uiAbsPartIdx ) )
829  {
830    assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
831    assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
832    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
833    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
834    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
835    return;
836  }
837#endif
838 
839#if H_3D_INTER_SDC
840  if( pcCU->getInterSDCFlag( uiAbsPartIdx ) )
841  {
842    assert( !pcCU->isSkipped( uiAbsPartIdx ) );
843    assert( !pcCU->isIntra( uiAbsPartIdx) );
844    assert( pcCU->getSlice()->getIsDepth() );
845
846    decodeInterSDCResidualData( pcCU, uiAbsPartIdx, uiDepth );
847    return;
848  }
849#endif
850#endif
851
852  if( pcCU->isIntra(uiAbsPartIdx) )
853  {
854  }
855  else
856  {
857    UInt uiQtRootCbf = 1;
858    if( !( pcCU->getPartitionSize( uiAbsPartIdx) == SIZE_2Nx2N && pcCU->getMergeFlag( uiAbsPartIdx ) ) )
859    {
860      m_pcEntropyDecoderIf->parseQtRootCbf( uiAbsPartIdx, uiQtRootCbf );
861    }
862    if ( !uiQtRootCbf )
863    {
864      pcCU->setCbfSubParts( 0, 0, 0, uiAbsPartIdx, uiDepth );
865      pcCU->setTrIdxSubParts( 0 , uiAbsPartIdx, uiDepth );
866      return;
867    }
868   
869  }
870
871  Int getQuadtreeTULog2MinSizeInCU = pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx);
872
873  xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP, getQuadtreeTULog2MinSizeInCU );
874}
875
876#if H_3D_INTER_SDC
877#if QC_SDC_UNIFY_G0130
878Void TDecEntropy::decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
879{
880  pcCU->setSDCFlagSubParts( false, uiAbsPartIdx, uiDepth );
881
882  if( ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) ) || 
883    ( pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getVPS()->getVpsDepthModesFlag( pcCU->getSlice()->getLayerIdInVps() ) ) )
884  {
885    return;
886  }
887
888#if SEC_INTER_SDC_G0101
889  if( !pcCU->getSlice()->getIsDepth() || pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N || pcCU->isSkipped( uiAbsPartIdx ) )
890#else
891  if( !pcCU->getSlice()->getIsDepth() || ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N ) || pcCU->isSkipped( uiAbsPartIdx ) )
892#endif
893  {
894    return;
895  }
896
897#if SEC_INTER_SDC_G0101
898  assert( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) );
899#else
900  assert( ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) );
901#endif
902
903  m_pcEntropyDecoderIf->parseSDCFlag( pcCU, uiAbsPartIdx, uiDepth );
904}
905
906#else
907Void TDecEntropy::decodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
908{
909  pcCU->setInterSDCFlagSubParts( false, uiAbsPartIdx, 0, uiDepth);
910
911  if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) )
912  {
913    return;
914  }
915
916  if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || pcCU->isSkipped( uiAbsPartIdx ) )
917  {
918    return;
919  }
920
921  m_pcEntropyDecoderIf->parseInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth );
922}
923
924Void TDecEntropy::decodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
925{
926  if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) )
927  {
928    return;
929  }
930
931  if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || !pcCU->getInterSDCFlag( uiAbsPartIdx ) )
932  {
933    return;
934  }
935
936  UInt uiNumSegments = ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) ? 1 : ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ? 4 : 2 );
937
938  // decode residual data for each segment
939  for( UInt uiSeg = 0; uiSeg < uiNumSegments; uiSeg++ )
940  {
941    m_pcEntropyDecoderIf->parseInterSDCResidualData( pcCU, uiAbsPartIdx, uiDepth, uiSeg );
942  }
943}
944#endif
945#endif
946#if H_3D_DBBP
947Void TDecEntropy::decodeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
948{
949  m_pcEntropyDecoderIf->parseDBBPFlag( pcCU, uiAbsPartIdx, uiDepth );
950}
951#endif
952
953//! \}
Note: See TracBrowser for help on using the repository browser.