source: 3DVCSoftware/branches/HTM-6.2-dev1-Qualcomm/source/Lib/TLibDecoder/TDecEntropy.cpp @ 1327

Last change on this file since 1327 was 355, checked in by zhang, 12 years ago

JCT3V-D0191 (BVSP clean-ups)

  • Property svn:eol-style set to native
File size: 32.7 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-2012, 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/TComAdaptiveLoopFilter.h"
49#include "TLibCommon/TComSampleAdaptiveOffset.h"
50
51Void TDecEntropy::decodeSkipFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
52{
53  m_pcEntropyDecoderIf->parseSkipFlag( pcCU, uiAbsPartIdx, uiDepth );
54}
55
56/** decode merge flag
57 * \param pcSubCU
58 * \param uiAbsPartIdx
59 * \param uiDepth
60 * \param uiPUIdx
61 * \returns Void
62 */
63Void TDecEntropy::decodeMergeFlag( TComDataCU* pcSubCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx )
64{ 
65  // at least one merge candidate exists
66  m_pcEntropyDecoderIf->parseMergeFlag( pcSubCU, uiAbsPartIdx, uiDepth, uiPUIdx );
67}
68
69#if LGE_ILLUCOMP_B0045
70Void TDecEntropy::decodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
71{
72  pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth );
73
74  if (pcCU->isIntra(uiAbsPartIdx) || (pcCU->getSlice()->getViewId() == 0) 
75#if !LGE_ILLUCOMP_DEPTH_C0046
76      || pcCU->getSlice()->getSPS()->isDepth()
77#endif
78      )
79  {
80    return;
81  }
82
83  if(!pcCU->getSlice()->getApplyIC())
84    return;
85
86#if LGE_ILLUCOMP_DEPTH_C0046
87  if(pcCU->isICFlagRequired(uiAbsPartIdx, uiDepth)) //This modification is not needed after integrating JCT3V-C0137
88#else
89  if(pcCU->isICFlagRequired(uiAbsPartIdx))
90#endif
91    m_pcEntropyDecoderIf->parseICFlag( pcCU, uiAbsPartIdx, uiDepth );
92}
93#endif
94/** decode merge index
95 * \param pcCU
96 * \param uiPartIdx
97 * \param uiAbsPartIdx
98 * \param puhInterDirNeighbours pointer to list of inter direction from the casual neighbours
99 * \param pcMvFieldNeighbours pointer to list of motion vector field from the casual neighbours
100 * \param uiDepth
101 * \returns Void
102 */
103Void TDecEntropy::decodeMergeIndex( TComDataCU* pcCU, UInt uiPartIdx, UInt uiAbsPartIdx, PartSize eCUMode, UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, UInt uiDepth )
104{
105  UInt uiMergeIndex = 0;
106  m_pcEntropyDecoderIf->parseMergeIndex( pcCU, uiMergeIndex, uiAbsPartIdx, uiDepth );
107  pcCU->setMergeIndexSubParts( uiMergeIndex, uiAbsPartIdx, uiPartIdx, uiDepth );
108}
109
110Void TDecEntropy::decodeSplitFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
111{
112  m_pcEntropyDecoderIf->parseSplitFlag( pcCU, uiAbsPartIdx, uiDepth );
113}
114
115Void TDecEntropy::decodePredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
116{
117  m_pcEntropyDecoderIf->parsePredMode( pcCU, uiAbsPartIdx, uiDepth );
118 
119#if RWTH_SDC_DLT_B0036
120  // if B-Slice, code SDC flag later
121  if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSlice()->getSPS()->isDepth() )
122  {
123    // decode SDC flag
124    decodeSDCFlag(pcCU, uiAbsPartIdx, uiDepth);
125  }
126#endif
127}
128
129Void TDecEntropy::decodePartSize( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
130{
131#if RWTH_SDC_DLT_B0036
132  if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSDCFlag(uiAbsPartIdx)  )
133  {
134    pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
135    pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth );
136    return;
137  }
138#endif
139 
140  m_pcEntropyDecoderIf->parsePartSize( pcCU, uiAbsPartIdx, uiDepth );
141 
142#if RWTH_SDC_DLT_B0036
143  if( pcCU->getSlice()->isInterB() && pcCU->getSlice()->getSPS()->isDepth() && pcCU->isIntra(uiAbsPartIdx) )
144  {
145    // decode SDC flag
146    decodeSDCFlag(pcCU, uiAbsPartIdx, uiDepth);
147   
148    if( pcCU->getSDCFlag(uiAbsPartIdx) )
149    {
150      // part size is also known for SDC intra
151      pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
152      pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth );
153    }
154  }
155#endif
156}
157
158Void TDecEntropy::decodePredInfo    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU )
159{
160#if RWTH_SDC_DLT_B0036
161  if( pcCU->getSDCFlag(uiAbsPartIdx) )
162  {
163    decodeSDCPredMode(pcCU, uiAbsPartIdx, uiDepth);
164    return;
165  }
166#endif
167 
168  PartSize eMode = pcCU->getPartitionSize( uiAbsPartIdx );
169 
170  if( pcCU->isIntra( uiAbsPartIdx ) )                                 // If it is Intra mode, encode intra prediction mode.
171  {
172    if( eMode == SIZE_NxN )                                         // if it is NxN size, encode 4 intra directions.
173    {
174      UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth(uiAbsPartIdx) << 1 ) ) >> 2;
175      // if it is NxN size, this size might be the smallest partition size.                                                         // if it is NxN size, this size might be the smallest partition size.
176      decodeIntraDirModeLuma( pcCU, uiAbsPartIdx,                  uiDepth+1 );
177      decodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset,   uiDepth+1 );
178      decodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*2, uiDepth+1 );
179      decodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*3, uiDepth+1 );
180      decodeIntraDirModeChroma( pcCU, uiAbsPartIdx, uiDepth );
181    }
182    else                                                                // if it is not NxN size, encode 1 intra directions
183    {
184      decodeIntraDirModeLuma  ( pcCU, uiAbsPartIdx, uiDepth );
185      decodeIntraDirModeChroma( pcCU, uiAbsPartIdx, uiDepth );
186    }
187  }
188  else                                                                // if it is Inter mode, encode motion vector and reference index
189  {
190    decodePUWise( pcCU, uiAbsPartIdx, uiDepth, pcSubCU );
191  }
192}
193
194/** Parse I_PCM information.
195 * \param pcCU  pointer to CUpointer to CU
196 * \param uiAbsPartIdx CU index
197 * \param uiDepth CU depth
198 * \returns Void
199 */
200Void TDecEntropy::decodeIPCMInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
201{
202  if(!pcCU->getSlice()->getSPS()->getUsePCM()
203    || pcCU->getWidth(uiAbsPartIdx) > (1<<pcCU->getSlice()->getSPS()->getPCMLog2MaxSize())
204    || pcCU->getWidth(uiAbsPartIdx) < (1<<pcCU->getSlice()->getSPS()->getPCMLog2MinSize()) )
205  {
206    return;
207  }
208 
209#if RWTH_SDC_DLT_B0036
210  if( pcCU->getSDCFlag(uiAbsPartIdx) )
211  {
212    return;
213  }
214#endif
215 
216  m_pcEntropyDecoderIf->parseIPCMInfo( pcCU, uiAbsPartIdx, uiDepth );
217}
218
219Void TDecEntropy::decodeIntraDirModeLuma  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
220{
221  m_pcEntropyDecoderIf->parseIntraDirLumaAng( pcCU, uiAbsPartIdx, uiDepth );
222}
223
224Void TDecEntropy::decodeIntraDirModeChroma( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
225{
226  m_pcEntropyDecoderIf->parseIntraDirChroma( pcCU, uiAbsPartIdx, uiDepth );
227}
228
229/** decode motion information for every PU block.
230 * \param pcCU
231 * \param uiAbsPartIdx
232 * \param uiDepth
233 * \param pcSubCU
234 * \returns Void
235 */
236Void TDecEntropy::decodePUWise( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU )
237{
238  PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
239  UInt uiNumPU = ( ePartSize == SIZE_2Nx2N ? 1 : ( ePartSize == SIZE_NxN ? 4 : 2 ) );
240  UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxCUDepth() - uiDepth ) << 1 ) ) >> 4;
241
242#if CU_BASED_MRG_CAND_LIST
243#if H3D_IVMP
244  TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists
245  UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];
246  for ( UInt ui = 0; ui < MRG_MAX_NUM_CANDS_MEM; ui++ )
247#else
248  TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists
249  UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS];
250  for ( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ui++ )
251#endif
252  {
253    uhInterDirNeighbours[ui] = 0;
254  }
255  Int numValidMergeCand = 0;
256  bool isMerged = false;
257#endif
258
259  pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 );
260  pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 );
261  for ( UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset )
262  {
263#if !CU_BASED_MRG_CAND_LIST
264#if H3D_IVMP
265    TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists
266    UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];
267    Int numValidMergeCand = 0;
268    for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS_MEM; ++ui )
269#else
270    TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists
271    UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS];
272    Int numValidMergeCand = 0;
273    for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ++ui )
274#endif
275    {
276      uhInterDirNeighbours[ui] = 0;
277    }
278#endif
279    decodeMergeFlag( pcCU, uiSubPartIdx, uiDepth, uiPartIdx );
280    if ( pcCU->getMergeFlag( uiSubPartIdx ) )
281    {
282      decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, ePartSize, uhInterDirNeighbours, cMvFieldNeighbours, uiDepth );
283#if CU_BASED_MRG_CAND_LIST
284      UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);
285      if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 ) 
286      {
287        pcSubCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );
288        if ( !isMerged )
289        {
290          pcSubCU->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
291          isMerged = true;
292        }
293        pcSubCU->setPartSizeSubParts( ePartSize, 0, uiDepth );
294      }
295      else
296      {
297        uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);
298        pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
299      }
300#else
301      UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);
302#if MERL_VSP_C0152
303      Int iVSPIndexTrue[3] = {-1, -1, -1};
304      pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, uiMergeIndex );
305
306#if HHI_MPI
307      if(pcCU->getTextureModeDepth( uiSubPartIdx ) == uiDepth)//MPI is used
308      {
309        TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() );
310        UInt uiCurrPartNumb = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1);
311        for( UInt ui = 0; ui < uiCurrPartNumb; ui++ )
312        {
313          Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui);
314          pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx);
315        }
316      }
317      else // MPI not used
318#endif
319      {
320        Int iVSPIdx = 0;
321        Int numVspIdx;
322        numVspIdx = 3;
323        for (Int i = 0; i < numVspIdx; i++)
324        {
325          if (iVSPIndexTrue[i] == uiMergeIndex)
326            {
327              iVSPIdx = i+1;
328              break;
329            }
330        }
331        pcCU->setVSPIndexSubParts( iVSPIdx, uiSubPartIdx, uiPartIdx, uiDepth );  //Initialize the VSP, may change later in get InterMergeCandidates()
332#if QC_BVSP_CleanUP_D0191
333       if(iVSPIdx != 0)
334       {
335         Int iIVCIdx = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, 0)->getPOC()==pcCU->getSlice()->getPOC() ? 0: pcCU->getSlice()->getNewRefIdx(REF_PIC_LIST_0);
336         cMvFieldNeighbours[ 2*uiMergeIndex].setRefIdx(iIVCIdx);
337       }
338#endif
339      }
340
341#else
342      pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
343#endif
344#endif
345      pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
346
347      TComMv cTmpMv( 0, 0 );
348      for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
349      {       
350        if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 )
351        {
352          pcCU->setMVPIdxSubParts( 0, RefPicList( uiRefListIdx ), uiSubPartIdx, uiPartIdx, uiDepth);
353          pcCU->setMVPNumSubParts( 0, RefPicList( uiRefListIdx ), uiSubPartIdx, uiPartIdx, uiDepth);
354          pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx );
355          pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx );
356
357        }
358      }
359    }
360    else
361    {
362      decodeInterDirPU( pcCU, uiSubPartIdx, uiDepth, uiPartIdx );
363      for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
364      {       
365        if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 )
366        {
367          decodeRefFrmIdxPU( pcCU,    uiSubPartIdx,              uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) );
368          decodeMvdPU      ( pcCU,    uiSubPartIdx,              uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) );
369          decodeMVPIdxPU   ( pcSubCU, uiSubPartIdx-uiAbsPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) );
370        }
371      }
372    }
373  }
374  return;
375}
376
377/** decode inter direction for a PU block
378 * \param pcCU
379 * \param uiAbsPartIdx
380 * \param uiDepth
381 * \param uiPartIdx
382 * \returns Void
383 */
384Void TDecEntropy::decodeInterDirPU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx )
385{
386  UInt uiInterDir;
387
388  if ( pcCU->getSlice()->isInterP() )
389  {
390    uiInterDir = 1;
391  }
392  else
393  {
394    m_pcEntropyDecoderIf->parseInterDir( pcCU, uiInterDir, uiAbsPartIdx, uiDepth );
395  }
396
397  pcCU->setInterDirSubParts( uiInterDir, uiAbsPartIdx, uiPartIdx, uiDepth );
398}
399
400Void TDecEntropy::decodeRefFrmIdxPU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList )
401{
402  if(pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && pcCU->getInterDir( uiAbsPartIdx ) != 3)
403  {
404    if(eRefList == REF_PIC_LIST_1)
405    {
406      return;
407    }
408
409    Int iRefFrmIdx = 0;
410    Int iRefFrmIdxTemp;
411    UInt uiInterDir;
412    RefPicList eRefListTemp;
413
414    PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
415
416    if ( pcCU->getSlice()->getNumRefIdx ( REF_PIC_LIST_C ) > 1 )
417    {
418      m_pcEntropyDecoderIf->parseRefFrmIdx( pcCU, iRefFrmIdx, uiAbsPartIdx, uiDepth, REF_PIC_LIST_C );
419    }
420    else
421    {
422      iRefFrmIdx=0;
423    }
424    uiInterDir = pcCU->getSlice()->getListIdFromIdxOfLC(iRefFrmIdx) + 1;
425    iRefFrmIdxTemp = pcCU->getSlice()->getRefIdxFromIdxOfLC(iRefFrmIdx);
426    eRefListTemp = (RefPicList)pcCU->getSlice()->getListIdFromIdxOfLC(iRefFrmIdx);
427
428    pcCU->getCUMvField( eRefListTemp )->setAllRefIdx( iRefFrmIdxTemp, ePartSize, uiAbsPartIdx, uiDepth, uiPartIdx );
429
430    pcCU->setInterDirSubParts( uiInterDir, uiAbsPartIdx, uiPartIdx, uiDepth );
431  }
432  else
433  {
434    Int iRefFrmIdx = 0;
435    Int iParseRefFrmIdx = pcCU->getInterDir( uiAbsPartIdx ) & ( 1 << eRefList );
436
437    if ( pcCU->getSlice()->getNumRefIdx( eRefList ) > 1 && iParseRefFrmIdx )
438    {
439      m_pcEntropyDecoderIf->parseRefFrmIdx( pcCU, iRefFrmIdx, uiAbsPartIdx, uiDepth, eRefList );
440    }
441    else if ( !iParseRefFrmIdx )
442    {
443      iRefFrmIdx = NOT_VALID;
444    }
445    else
446    {
447      iRefFrmIdx = 0;
448    }
449
450    PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
451    pcCU->getCUMvField( eRefList )->setAllRefIdx( iRefFrmIdx, ePartSize, uiAbsPartIdx, uiDepth, uiPartIdx );
452  }
453}
454
455/** decode motion vector difference for a PU block
456 * \param pcCU
457 * \param uiAbsPartIdx
458 * \param uiDepth
459 * \param uiPartIdx
460 * \param eRefList
461 * \returns Void
462 */
463Void TDecEntropy::decodeMvdPU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList )
464{
465  if ( pcCU->getInterDir( uiAbsPartIdx ) & ( 1 << eRefList ) )
466  {
467    m_pcEntropyDecoderIf->parseMvd( pcCU, uiAbsPartIdx, uiPartIdx, uiDepth, eRefList );
468  }
469}
470
471Void TDecEntropy::decodeMVPIdxPU( TComDataCU* pcSubCU, UInt uiPartAddr, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList )
472{
473  Int iMVPIdx = -1;
474
475  TComMv cZeroMv( 0, 0 );
476  TComMv cMv     = cZeroMv;
477  Int    iRefIdx = -1;
478
479  TComCUMvField* pcSubCUMvField = pcSubCU->getCUMvField( eRefList );
480  AMVPInfo* pAMVPInfo = pcSubCUMvField->getAMVPInfo();
481
482  iRefIdx = pcSubCUMvField->getRefIdx(uiPartAddr);
483  cMv = cZeroMv;
484
485  if ( (pcSubCU->getInterDir(uiPartAddr) & ( 1 << eRefList )) && (pcSubCU->getAMVPMode(uiPartAddr) == AM_EXPL) )
486  {
487#if H3D_IVMP
488#if SEC_TWO_CANDIDATES_FOR_AMVP_D0122
489    const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS;
490#else
491    const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcSubCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
492#endif
493    m_pcEntropyDecoderIf->parseMVPIdx( iMVPIdx, iNumAMVPCands );
494#else
495    m_pcEntropyDecoderIf->parseMVPIdx( iMVPIdx );
496#endif
497  }
498#if H3D_IVMP
499  pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo, iMVPIdx);
500#else
501  pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo);
502#endif
503  pcSubCU->setMVPNumSubParts(pAMVPInfo->iN, eRefList, uiPartAddr, uiPartIdx, uiDepth);
504  pcSubCU->setMVPIdxSubParts( iMVPIdx, eRefList, uiPartAddr, uiPartIdx, uiDepth );
505  if ( iRefIdx >= 0 )
506  {
507    m_pcPrediction->getMvPredAMVP( pcSubCU, uiPartIdx, uiPartAddr, eRefList, iRefIdx, cMv);
508    cMv += pcSubCUMvField->getMvd( uiPartAddr );
509  }
510
511  PartSize ePartSize = pcSubCU->getPartitionSize( uiPartAddr );
512  pcSubCU->getCUMvField( eRefList )->setAllMv(cMv, ePartSize, uiPartAddr, 0, uiPartIdx);
513}
514
515Void TDecEntropy::xDecodeTransform( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, UInt uiInnerQuadIdx, UInt& uiYCbfFront3, UInt& uiUCbfFront3, UInt& uiVCbfFront3, Bool& bCodeDQP )
516{
517  UInt uiSubdiv;
518  const UInt uiLog2TrafoSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()]+2 - uiDepth;
519
520  if(uiTrIdx==0)
521  {
522    m_bakAbsPartIdxCU = uiAbsPartIdx;
523  }
524  if( uiLog2TrafoSize == 2 )
525  {
526    UInt partNum = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 );
527    if( ( uiAbsPartIdx % partNum ) == 0 )
528    {
529      m_uiBakAbsPartIdx   = uiAbsPartIdx;
530      m_uiBakChromaOffset = offsetChroma;
531    }
532  }
533  if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTRA && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_NxN && uiDepth == pcCU->getDepth(uiAbsPartIdx) )
534  {
535    uiSubdiv = 1;
536  }
537  else if( (pcCU->getSlice()->getSPS()->getQuadtreeTUMaxDepthInter() == 1) && (pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER) && ( pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N ) && (uiDepth == pcCU->getDepth(uiAbsPartIdx)) )
538  {
539    uiSubdiv = (uiLog2TrafoSize > pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx));
540  }
541  else if( uiLog2TrafoSize > pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() )
542  {
543    uiSubdiv = 1;
544  }
545  else if( uiLog2TrafoSize == pcCU->getSlice()->getSPS()->getQuadtreeTULog2MinSize() )
546  {
547    uiSubdiv = 0;
548  }
549  else if( uiLog2TrafoSize == pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx) )
550  {
551    uiSubdiv = 0;
552  }
553  else
554  {
555    assert( uiLog2TrafoSize > pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx) );
556    m_pcEntropyDecoderIf->parseTransformSubdivFlag( uiSubdiv, uiDepth );
557  }
558 
559  const UInt uiTrDepth = uiDepth - pcCU->getDepth( uiAbsPartIdx );
560 
561  if( uiLog2TrafoSize <= pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() )
562  {
563    const Bool bFirstCbfOfCU = uiLog2TrafoSize == pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() || uiTrDepth == 0;
564    if( bFirstCbfOfCU )
565    {
566      pcCU->setCbfSubParts( 0, TEXT_CHROMA_U, uiAbsPartIdx, uiDepth );
567      pcCU->setCbfSubParts( 0, TEXT_CHROMA_V, uiAbsPartIdx, uiDepth );
568    }
569    if( bFirstCbfOfCU || uiLog2TrafoSize > 2 )
570    {
571      if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) )
572      {
573        if ( uiInnerQuadIdx == 3 && uiUCbfFront3 == 0 && uiLog2TrafoSize < pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() )
574        {
575          uiUCbfFront3++;
576          pcCU->setCbfSubParts( 1 << uiTrDepth, TEXT_CHROMA_U, uiAbsPartIdx, uiDepth );
577          //printf( " \nsave bits, U Cbf");
578        }
579        else
580        {
581          m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth, uiDepth );
582          uiUCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth );
583        }
584      }
585      if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth - 1 ) )
586      {
587        if ( uiInnerQuadIdx == 3 && uiVCbfFront3 == 0 && uiLog2TrafoSize < pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() )
588        {
589          uiVCbfFront3++;
590          pcCU->setCbfSubParts( 1 << uiTrDepth, TEXT_CHROMA_V, uiAbsPartIdx, uiDepth );
591          //printf( " \nsave bits, V Cbf");
592        }
593        else
594        {
595          m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth, uiDepth );
596          uiVCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth );
597        }
598      }
599    }
600    else
601    {
602      pcCU->setCbfSubParts( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) << uiTrDepth, TEXT_CHROMA_U, uiAbsPartIdx, uiDepth );
603      pcCU->setCbfSubParts( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth - 1 ) << uiTrDepth, TEXT_CHROMA_V, uiAbsPartIdx, uiDepth );
604      if ( uiLog2TrafoSize == 2 )
605      {
606        uiUCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth );
607        uiVCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth );
608      }
609    }
610  }
611 
612  if( uiSubdiv )
613  {
614    UInt size;
615    width  >>= 1;
616    height >>= 1;
617    size = width*height;
618    uiTrIdx++;
619    ++uiDepth;
620    const UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1);
621    const UInt uiStartAbsPartIdx = uiAbsPartIdx;
622    UInt uiLumaTrMode, uiChromaTrMode;
623    pcCU->convertTransIdx( uiStartAbsPartIdx, uiTrDepth+1, uiLumaTrMode, uiChromaTrMode );
624    UInt uiYCbf = 0;
625    UInt uiUCbf = 0;
626    UInt uiVCbf = 0;
627   
628    UInt uiCurrentCbfY = 0;
629    UInt uiCurrentCbfU = 0;
630    UInt uiCurrentCbfV = 0;
631   
632    for( Int i = 0; i < 4; i++ )
633    {
634      UInt nsAddr = 0;
635      nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, i, uiTrDepth+1 );
636      xDecodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, nsAddr, uiDepth, width, height, uiTrIdx, i, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV, bCodeDQP );
637      uiYCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode );
638      uiUCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiChromaTrMode );
639      uiVCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiChromaTrMode );
640      uiAbsPartIdx += uiQPartNum;
641      offsetLuma += size;  offsetChroma += (size>>2);
642    }
643   
644    uiYCbfFront3 += uiCurrentCbfY;
645    uiUCbfFront3 += uiCurrentCbfU;
646    uiVCbfFront3 += uiCurrentCbfV;
647   
648    pcCU->convertTransIdx( uiStartAbsPartIdx, uiTrDepth, uiLumaTrMode, uiChromaTrMode );
649    for( UInt ui = 0; ui < 4 * uiQPartNum; ++ui )
650    {
651      pcCU->getCbf( TEXT_LUMA     )[uiStartAbsPartIdx + ui] |= uiYCbf << uiLumaTrMode;
652      pcCU->getCbf( TEXT_CHROMA_U )[uiStartAbsPartIdx + ui] |= uiUCbf << uiChromaTrMode;
653      pcCU->getCbf( TEXT_CHROMA_V )[uiStartAbsPartIdx + ui] |= uiVCbf << uiChromaTrMode;
654    }
655  }
656  else
657  {
658    assert( uiDepth >= pcCU->getDepth( uiAbsPartIdx ) );
659    pcCU->setTrIdxSubParts( uiTrDepth, uiAbsPartIdx, uiDepth );
660   
661    {
662      DTRACE_CABAC_VL( g_nSymbolCounter++ );
663      DTRACE_CABAC_T( "\tTrIdx: abspart=" );
664      DTRACE_CABAC_V( uiAbsPartIdx );
665      DTRACE_CABAC_T( "\tdepth=" );
666      DTRACE_CABAC_V( uiDepth );
667      DTRACE_CABAC_T( "\ttrdepth=" );
668      DTRACE_CABAC_V( uiTrDepth );
669      DTRACE_CABAC_T( "\n" );
670    }
671   
672    UInt uiLumaTrMode, uiChromaTrMode;
673    pcCU->convertTransIdx( uiAbsPartIdx, uiTrDepth, uiLumaTrMode, uiChromaTrMode );
674    if(pcCU->getPredictionMode( uiAbsPartIdx ) == MODE_INTER && pcCU->useNonSquarePU( uiAbsPartIdx ) )
675    {
676      pcCU->setNSQTIdxSubParts( uiLog2TrafoSize, uiAbsPartIdx, absTUPartIdx, uiLumaTrMode );
677    }
678    pcCU->setCbfSubParts ( 0, TEXT_LUMA, uiAbsPartIdx, uiDepth );
679    if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) )
680    {
681      pcCU->setCbfSubParts( 1 << uiLumaTrMode, TEXT_LUMA, uiAbsPartIdx, uiDepth );
682    }
683    else
684    {
685      const UInt uiLog2CUSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()] + 2 - pcCU->getDepth( uiAbsPartIdx );
686      if ( pcCU->getPredictionMode( uiAbsPartIdx ) != MODE_INTRA && uiInnerQuadIdx == 3 && uiYCbfFront3 == 0 && uiUCbfFront3 == 0 && uiVCbfFront3 == 0
687          && ( uiLog2CUSize <= pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() + 1 || uiLog2TrafoSize < pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) )
688      {
689        pcCU->setCbfSubParts( 1 << uiLumaTrMode, TEXT_LUMA, uiAbsPartIdx, uiDepth );
690        //printf( " \nsave bits, Y Cbf");
691        uiYCbfFront3++;   
692      }
693      else
694      {
695        m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode, uiDepth );
696        uiYCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode );
697      }
698    }
699    // transform_unit begin
700    UInt cbfY = pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA    , uiTrIdx );
701    UInt cbfU = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx );
702    UInt cbfV = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx );
703    if( uiLog2TrafoSize == 2 )
704    {
705      UInt partNum = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 );
706      if( ( uiAbsPartIdx % partNum ) == (partNum - 1) )
707      {
708        cbfU = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx );
709        cbfV = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx );
710      }
711    }
712    if ( cbfY || cbfU || cbfV )
713    {
714      // dQP: only for LCU
715      if ( pcCU->getSlice()->getPPS()->getUseDQP() )
716      {
717        if ( bCodeDQP )
718        {
719          decodeQP( pcCU, m_bakAbsPartIdxCU);
720          bCodeDQP = false;
721        }
722      }
723    }
724    if( cbfY )
725    {
726      Int trWidth = width;
727      Int trHeight = height;
728      pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight );
729      m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffY()+offsetLuma), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_LUMA );
730    }
731    if( uiLog2TrafoSize > 2 )
732    {
733      Int trWidth = width >> 1;
734      Int trHeight = height >> 1;
735      pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight );
736      if( cbfU )
737      {
738        m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCb()+offsetChroma), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U );
739      }
740      if( cbfV )
741      {
742        m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCr()+offsetChroma), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V );
743      }
744    }
745    else
746    {
747      UInt partNum = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 );
748      if( ( uiAbsPartIdx % partNum ) == (partNum - 1) )
749      {
750        Int trWidth = width;
751        Int trHeight = height;
752        pcCU->getNSQTSize( uiTrIdx - 1, uiAbsPartIdx, trWidth, trHeight );
753        if( cbfU )
754        {
755          m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCb()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U );
756        }
757        if( cbfV )
758        {
759          m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCr()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V );
760        }
761      }
762    }
763    // transform_unit end
764  }
765}
766
767
768Void TDecEntropy::decodeQP          ( TComDataCU* pcCU, UInt uiAbsPartIdx )
769{
770  if ( pcCU->getSlice()->getPPS()->getUseDQP() )
771  {
772    m_pcEntropyDecoderIf->parseDeltaQP( pcCU, uiAbsPartIdx, pcCU->getDepth( uiAbsPartIdx ) );
773  }
774}
775
776
777/** decode coefficients
778 * \param pcCU
779 * \param uiAbsPartIdx
780 * \param uiDepth
781 * \param uiWidth
782 * \param uiHeight
783 * \returns Void
784 */
785Void TDecEntropy::decodeCoeff( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP )
786{
787  UInt uiMinCoeffSize = pcCU->getPic()->getMinCUWidth()*pcCU->getPic()->getMinCUHeight();
788  UInt uiLumaOffset   = uiMinCoeffSize*uiAbsPartIdx;
789  UInt uiChromaOffset = uiLumaOffset>>2;
790  UInt temp  = 0;
791  UInt temp1 = 0;
792  UInt temp2 = 0;
793 
794#if RWTH_SDC_DLT_B0036
795  if( pcCU->getSDCAvailable(uiAbsPartIdx) && pcCU->getSDCFlag( uiAbsPartIdx ) )
796  {
797    assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
798    assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
799    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
800    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
801    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
802   
803    decodeSDCResidualData(pcCU, uiAbsPartIdx, uiDepth);
804    return;
805  }
806#endif
807 
808  if( pcCU->isIntra(uiAbsPartIdx) )
809  {
810  }
811  else
812  {
813    UInt uiQtRootCbf = 1;
814#if HHI_MPI
815    if( !(pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N &&
816          ( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 || uiDepth == pcCU->getTextureModeDepth( uiAbsPartIdx ) ) ) )
817#else
818    if( !( pcCU->getPartitionSize( uiAbsPartIdx) == SIZE_2Nx2N && pcCU->getMergeFlag( uiAbsPartIdx ) ) )
819#endif
820    {
821      m_pcEntropyDecoderIf->parseQtRootCbf( pcCU, uiAbsPartIdx, uiDepth, uiQtRootCbf );
822    }
823    if ( !uiQtRootCbf )
824    {
825      pcCU->setCbfSubParts( 0, 0, 0, uiAbsPartIdx, uiDepth );
826      pcCU->setTrIdxSubParts( 0 , uiAbsPartIdx, uiDepth );
827      pcCU->setNSQTIdxSubParts( uiAbsPartIdx, uiDepth );
828      return;
829    }
830   
831  }
832
833#if FIX_MPI_B0065
834  if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER && pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getMergeIndex( uiAbsPartIdx ) == 0 && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N &&  pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1  )
835  {
836    TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() );
837    if( uiDepth == pcTextureCU->getDepth(uiAbsPartIdx))
838    {
839      PartSize partSize = pcTextureCU->getPartitionSize(uiAbsPartIdx);
840      pcCU->setPartSizeSubParts( partSize, uiAbsPartIdx, uiDepth );
841    }
842    else
843    {
844      pcCU->setPartSizeSubParts( SIZE_NxN, uiAbsPartIdx, uiDepth );
845    }
846  }
847#endif
848
849  xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, 0, temp, temp1, temp2, bCodeDQP );
850
851#if FIX_MPI_B0065
852  if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER && pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getMergeIndex( uiAbsPartIdx ) == 0 && pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N &&  pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1 )
853  {
854    pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 
855  }
856#endif
857}
858
859#if RWTH_SDC_DLT_B0036
860Void TDecEntropy::decodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
861{
862  assert( pcCU->getSlice()->getSPS()->isDepth() );
863  assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
864 
865  m_pcEntropyDecoderIf->parseSDCPredMode(pcCU, uiAbsPartIdx, uiDepth );
866}
867
868Void TDecEntropy::decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
869{
870  assert( pcCU->getSlice()->getSPS()->isDepth() );
871 
872  m_pcEntropyDecoderIf->parseSDCFlag(pcCU, uiAbsPartIdx, uiDepth );
873}
874
875Void TDecEntropy::decodeSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
876{
877  assert( pcCU->getSlice()->getSPS()->isDepth() );
878  assert( pcCU->getSDCFlag(uiAbsPartIdx) );
879 
880  // number of segments depends on prediction mode for INTRA
881  UInt uiNumSegments = 2;
882  UInt uiLumaPredMode = pcCU->getLumaIntraDir( uiAbsPartIdx );
883  if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTRA && (uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX) )
884    uiNumSegments = 1;
885 
886  // decode residual data for each segment
887  for( UInt uiSeg = 0; uiSeg < uiNumSegments; uiSeg++ )
888    m_pcEntropyDecoderIf->parseSDCResidualData(pcCU, uiAbsPartIdx, uiDepth, uiSeg);
889}
890#endif
891
892//! \}
Note: See TracBrowser for help on using the repository browser.