source: 3DVCSoftware/branches/HTM-11.2-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp @ 1038

Last change on this file since 1038 was 1038, checked in by sharpjp-htm, 10 years ago

Fix tickets #75 Bi-pred restriction bug in VSP
Fix tickets #79 Unused VSP code

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