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

Last change on this file since 347 was 347, checked in by samsung-htm, 12 years ago

D0122 Integration

File size: 33.2 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      }
333
334#else
335      pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
336#endif
337#endif
338      pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
339
340      TComMv cTmpMv( 0, 0 );
341      for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
342      {       
343        if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 )
344        {
345          pcCU->setMVPIdxSubParts( 0, RefPicList( uiRefListIdx ), uiSubPartIdx, uiPartIdx, uiDepth);
346          pcCU->setMVPNumSubParts( 0, RefPicList( uiRefListIdx ), uiSubPartIdx, uiPartIdx, uiDepth);
347          pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx );
348          pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx );
349
350        }
351      }
352    }
353    else
354    {
355      decodeInterDirPU( pcCU, uiSubPartIdx, uiDepth, uiPartIdx );
356      for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
357      {       
358        if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 )
359        {
360          decodeRefFrmIdxPU( pcCU,    uiSubPartIdx,              uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) );
361          decodeMvdPU      ( pcCU,    uiSubPartIdx,              uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) );
362          decodeMVPIdxPU   ( pcSubCU, uiSubPartIdx-uiAbsPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) );
363        }
364      }
365    }
366  }
367  return;
368}
369
370/** decode inter direction for a PU block
371 * \param pcCU
372 * \param uiAbsPartIdx
373 * \param uiDepth
374 * \param uiPartIdx
375 * \returns Void
376 */
377Void TDecEntropy::decodeInterDirPU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx )
378{
379  UInt uiInterDir;
380
381  if ( pcCU->getSlice()->isInterP() )
382  {
383    uiInterDir = 1;
384  }
385  else
386  {
387    m_pcEntropyDecoderIf->parseInterDir( pcCU, uiInterDir, uiAbsPartIdx, uiDepth );
388  }
389
390  pcCU->setInterDirSubParts( uiInterDir, uiAbsPartIdx, uiPartIdx, uiDepth );
391}
392
393Void TDecEntropy::decodeRefFrmIdxPU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList )
394{
395  if(pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && pcCU->getInterDir( uiAbsPartIdx ) != 3)
396  {
397    if(eRefList == REF_PIC_LIST_1)
398    {
399      return;
400    }
401
402    Int iRefFrmIdx = 0;
403    Int iRefFrmIdxTemp;
404    UInt uiInterDir;
405    RefPicList eRefListTemp;
406
407    PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
408
409    if ( pcCU->getSlice()->getNumRefIdx ( REF_PIC_LIST_C ) > 1 )
410    {
411      m_pcEntropyDecoderIf->parseRefFrmIdx( pcCU, iRefFrmIdx, uiAbsPartIdx, uiDepth, REF_PIC_LIST_C );
412    }
413    else
414    {
415      iRefFrmIdx=0;
416    }
417    uiInterDir = pcCU->getSlice()->getListIdFromIdxOfLC(iRefFrmIdx) + 1;
418    iRefFrmIdxTemp = pcCU->getSlice()->getRefIdxFromIdxOfLC(iRefFrmIdx);
419    eRefListTemp = (RefPicList)pcCU->getSlice()->getListIdFromIdxOfLC(iRefFrmIdx);
420
421    pcCU->getCUMvField( eRefListTemp )->setAllRefIdx( iRefFrmIdxTemp, ePartSize, uiAbsPartIdx, uiDepth, uiPartIdx );
422
423    pcCU->setInterDirSubParts( uiInterDir, uiAbsPartIdx, uiPartIdx, uiDepth );
424  }
425  else
426  {
427    Int iRefFrmIdx = 0;
428    Int iParseRefFrmIdx = pcCU->getInterDir( uiAbsPartIdx ) & ( 1 << eRefList );
429
430    if ( pcCU->getSlice()->getNumRefIdx( eRefList ) > 1 && iParseRefFrmIdx )
431    {
432      m_pcEntropyDecoderIf->parseRefFrmIdx( pcCU, iRefFrmIdx, uiAbsPartIdx, uiDepth, eRefList );
433    }
434    else if ( !iParseRefFrmIdx )
435    {
436      iRefFrmIdx = NOT_VALID;
437    }
438    else
439    {
440      iRefFrmIdx = 0;
441    }
442
443    PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
444    pcCU->getCUMvField( eRefList )->setAllRefIdx( iRefFrmIdx, ePartSize, uiAbsPartIdx, uiDepth, uiPartIdx );
445  }
446}
447
448/** decode motion vector difference for a PU block
449 * \param pcCU
450 * \param uiAbsPartIdx
451 * \param uiDepth
452 * \param uiPartIdx
453 * \param eRefList
454 * \returns Void
455 */
456Void TDecEntropy::decodeMvdPU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList )
457{
458  if ( pcCU->getInterDir( uiAbsPartIdx ) & ( 1 << eRefList ) )
459  {
460    m_pcEntropyDecoderIf->parseMvd( pcCU, uiAbsPartIdx, uiPartIdx, uiDepth, eRefList );
461  }
462}
463
464Void TDecEntropy::decodeMVPIdxPU( TComDataCU* pcSubCU, UInt uiPartAddr, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList )
465{
466  Int iMVPIdx = -1;
467
468  TComMv cZeroMv( 0, 0 );
469  TComMv cMv     = cZeroMv;
470  Int    iRefIdx = -1;
471
472  TComCUMvField* pcSubCUMvField = pcSubCU->getCUMvField( eRefList );
473  AMVPInfo* pAMVPInfo = pcSubCUMvField->getAMVPInfo();
474
475  iRefIdx = pcSubCUMvField->getRefIdx(uiPartAddr);
476  cMv = cZeroMv;
477
478  if ( (pcSubCU->getInterDir(uiPartAddr) & ( 1 << eRefList )) && (pcSubCU->getAMVPMode(uiPartAddr) == AM_EXPL) )
479  {
480#if H3D_IVMP
481#if SEC_TWO_CANDIDATES_FOR_AMVP_D0122
482    const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS;
483#else
484    const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcSubCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
485#endif
486    m_pcEntropyDecoderIf->parseMVPIdx( iMVPIdx, iNumAMVPCands );
487#else
488    m_pcEntropyDecoderIf->parseMVPIdx( iMVPIdx );
489#endif
490  }
491#if H3D_IVMP
492  pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo, iMVPIdx);
493#else
494  pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo);
495#endif
496  pcSubCU->setMVPNumSubParts(pAMVPInfo->iN, eRefList, uiPartAddr, uiPartIdx, uiDepth);
497  pcSubCU->setMVPIdxSubParts( iMVPIdx, eRefList, uiPartAddr, uiPartIdx, uiDepth );
498  if ( iRefIdx >= 0 )
499  {
500    m_pcPrediction->getMvPredAMVP( pcSubCU, uiPartIdx, uiPartAddr, eRefList, iRefIdx, cMv);
501    cMv += pcSubCUMvField->getMvd( uiPartAddr );
502  }
503
504  PartSize ePartSize = pcSubCU->getPartitionSize( uiPartAddr );
505  pcSubCU->getCUMvField( eRefList )->setAllMv(cMv, ePartSize, uiPartAddr, 0, uiPartIdx);
506}
507
508Void 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 )
509{
510  UInt uiSubdiv;
511  const UInt uiLog2TrafoSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()]+2 - uiDepth;
512
513  if(uiTrIdx==0)
514  {
515    m_bakAbsPartIdxCU = uiAbsPartIdx;
516  }
517  if( uiLog2TrafoSize == 2 )
518  {
519    UInt partNum = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 );
520    if( ( uiAbsPartIdx % partNum ) == 0 )
521    {
522      m_uiBakAbsPartIdx   = uiAbsPartIdx;
523      m_uiBakChromaOffset = offsetChroma;
524    }
525  }
526  if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTRA && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_NxN && uiDepth == pcCU->getDepth(uiAbsPartIdx) )
527  {
528    uiSubdiv = 1;
529  }
530  else if( (pcCU->getSlice()->getSPS()->getQuadtreeTUMaxDepthInter() == 1) && (pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER) && ( pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N ) && (uiDepth == pcCU->getDepth(uiAbsPartIdx)) )
531  {
532    uiSubdiv = (uiLog2TrafoSize > pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx));
533  }
534  else if( uiLog2TrafoSize > pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() )
535  {
536    uiSubdiv = 1;
537  }
538  else if( uiLog2TrafoSize == pcCU->getSlice()->getSPS()->getQuadtreeTULog2MinSize() )
539  {
540    uiSubdiv = 0;
541  }
542  else if( uiLog2TrafoSize == pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx) )
543  {
544    uiSubdiv = 0;
545  }
546  else
547  {
548    assert( uiLog2TrafoSize > pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx) );
549    m_pcEntropyDecoderIf->parseTransformSubdivFlag( uiSubdiv, uiDepth );
550  }
551 
552  const UInt uiTrDepth = uiDepth - pcCU->getDepth( uiAbsPartIdx );
553 
554  if( uiLog2TrafoSize <= pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() )
555  {
556    const Bool bFirstCbfOfCU = uiLog2TrafoSize == pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() || uiTrDepth == 0;
557    if( bFirstCbfOfCU )
558    {
559      pcCU->setCbfSubParts( 0, TEXT_CHROMA_U, uiAbsPartIdx, uiDepth );
560      pcCU->setCbfSubParts( 0, TEXT_CHROMA_V, uiAbsPartIdx, uiDepth );
561    }
562    if( bFirstCbfOfCU || uiLog2TrafoSize > 2 )
563    {
564      if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) )
565      {
566        if ( uiInnerQuadIdx == 3 && uiUCbfFront3 == 0 && uiLog2TrafoSize < pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() )
567        {
568          uiUCbfFront3++;
569          pcCU->setCbfSubParts( 1 << uiTrDepth, TEXT_CHROMA_U, uiAbsPartIdx, uiDepth );
570          //printf( " \nsave bits, U Cbf");
571        }
572        else
573        {
574          m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth, uiDepth );
575          uiUCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth );
576        }
577      }
578      if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth - 1 ) )
579      {
580        if ( uiInnerQuadIdx == 3 && uiVCbfFront3 == 0 && uiLog2TrafoSize < pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() )
581        {
582          uiVCbfFront3++;
583          pcCU->setCbfSubParts( 1 << uiTrDepth, TEXT_CHROMA_V, uiAbsPartIdx, uiDepth );
584          //printf( " \nsave bits, V Cbf");
585        }
586        else
587        {
588          m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth, uiDepth );
589          uiVCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth );
590        }
591      }
592    }
593    else
594    {
595      pcCU->setCbfSubParts( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) << uiTrDepth, TEXT_CHROMA_U, uiAbsPartIdx, uiDepth );
596      pcCU->setCbfSubParts( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth - 1 ) << uiTrDepth, TEXT_CHROMA_V, uiAbsPartIdx, uiDepth );
597      if ( uiLog2TrafoSize == 2 )
598      {
599        uiUCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth );
600        uiVCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth );
601      }
602    }
603  }
604 
605  if( uiSubdiv )
606  {
607    UInt size;
608    width  >>= 1;
609    height >>= 1;
610    size = width*height;
611    uiTrIdx++;
612    ++uiDepth;
613    const UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1);
614    const UInt uiStartAbsPartIdx = uiAbsPartIdx;
615    UInt uiLumaTrMode, uiChromaTrMode;
616    pcCU->convertTransIdx( uiStartAbsPartIdx, uiTrDepth+1, uiLumaTrMode, uiChromaTrMode );
617    UInt uiYCbf = 0;
618    UInt uiUCbf = 0;
619    UInt uiVCbf = 0;
620   
621    UInt uiCurrentCbfY = 0;
622    UInt uiCurrentCbfU = 0;
623    UInt uiCurrentCbfV = 0;
624   
625    for( Int i = 0; i < 4; i++ )
626    {
627      UInt nsAddr = 0;
628      nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, i, uiTrDepth+1 );
629      xDecodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, nsAddr, uiDepth, width, height, uiTrIdx, i, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV, bCodeDQP );
630      uiYCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode );
631      uiUCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiChromaTrMode );
632      uiVCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiChromaTrMode );
633      uiAbsPartIdx += uiQPartNum;
634      offsetLuma += size;  offsetChroma += (size>>2);
635    }
636   
637    uiYCbfFront3 += uiCurrentCbfY;
638    uiUCbfFront3 += uiCurrentCbfU;
639    uiVCbfFront3 += uiCurrentCbfV;
640   
641    pcCU->convertTransIdx( uiStartAbsPartIdx, uiTrDepth, uiLumaTrMode, uiChromaTrMode );
642    for( UInt ui = 0; ui < 4 * uiQPartNum; ++ui )
643    {
644      pcCU->getCbf( TEXT_LUMA     )[uiStartAbsPartIdx + ui] |= uiYCbf << uiLumaTrMode;
645      pcCU->getCbf( TEXT_CHROMA_U )[uiStartAbsPartIdx + ui] |= uiUCbf << uiChromaTrMode;
646      pcCU->getCbf( TEXT_CHROMA_V )[uiStartAbsPartIdx + ui] |= uiVCbf << uiChromaTrMode;
647    }
648  }
649  else
650  {
651    assert( uiDepth >= pcCU->getDepth( uiAbsPartIdx ) );
652    pcCU->setTrIdxSubParts( uiTrDepth, uiAbsPartIdx, uiDepth );
653   
654    {
655      DTRACE_CABAC_VL( g_nSymbolCounter++ );
656      DTRACE_CABAC_T( "\tTrIdx: abspart=" );
657      DTRACE_CABAC_V( uiAbsPartIdx );
658      DTRACE_CABAC_T( "\tdepth=" );
659      DTRACE_CABAC_V( uiDepth );
660      DTRACE_CABAC_T( "\ttrdepth=" );
661      DTRACE_CABAC_V( uiTrDepth );
662      DTRACE_CABAC_T( "\n" );
663    }
664   
665    UInt uiLumaTrMode, uiChromaTrMode;
666    pcCU->convertTransIdx( uiAbsPartIdx, uiTrDepth, uiLumaTrMode, uiChromaTrMode );
667    if(pcCU->getPredictionMode( uiAbsPartIdx ) == MODE_INTER && pcCU->useNonSquarePU( uiAbsPartIdx ) )
668    {
669      pcCU->setNSQTIdxSubParts( uiLog2TrafoSize, uiAbsPartIdx, absTUPartIdx, uiLumaTrMode );
670    }
671    pcCU->setCbfSubParts ( 0, TEXT_LUMA, uiAbsPartIdx, uiDepth );
672    if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) )
673    {
674      pcCU->setCbfSubParts( 1 << uiLumaTrMode, TEXT_LUMA, uiAbsPartIdx, uiDepth );
675    }
676    else
677    {
678      const UInt uiLog2CUSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()] + 2 - pcCU->getDepth( uiAbsPartIdx );
679      if ( pcCU->getPredictionMode( uiAbsPartIdx ) != MODE_INTRA && uiInnerQuadIdx == 3 && uiYCbfFront3 == 0 && uiUCbfFront3 == 0 && uiVCbfFront3 == 0
680          && ( uiLog2CUSize <= pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() + 1 || uiLog2TrafoSize < pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) )
681      {
682        pcCU->setCbfSubParts( 1 << uiLumaTrMode, TEXT_LUMA, uiAbsPartIdx, uiDepth );
683        //printf( " \nsave bits, Y Cbf");
684        uiYCbfFront3++;   
685      }
686      else
687      {
688        m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode, uiDepth );
689        uiYCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode );
690      }
691    }
692    // transform_unit begin
693    UInt cbfY = pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA    , uiTrIdx );
694    UInt cbfU = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx );
695    UInt cbfV = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx );
696    if( uiLog2TrafoSize == 2 )
697    {
698      UInt partNum = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 );
699      if( ( uiAbsPartIdx % partNum ) == (partNum - 1) )
700      {
701        cbfU = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx );
702        cbfV = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx );
703      }
704    }
705    if ( cbfY || cbfU || cbfV )
706    {
707      // dQP: only for LCU
708      if ( pcCU->getSlice()->getPPS()->getUseDQP() )
709      {
710        if ( bCodeDQP )
711        {
712          decodeQP( pcCU, m_bakAbsPartIdxCU);
713          bCodeDQP = false;
714        }
715      }
716    }
717    if( cbfY )
718    {
719      Int trWidth = width;
720      Int trHeight = height;
721      pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight );
722      m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffY()+offsetLuma), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_LUMA );
723    }
724    if( uiLog2TrafoSize > 2 )
725    {
726      Int trWidth = width >> 1;
727      Int trHeight = height >> 1;
728      pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight );
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        pcCU->getNSQTSize( uiTrIdx - 1, uiAbsPartIdx, trWidth, trHeight );
746        if( cbfU )
747        {
748          m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCb()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U );
749        }
750        if( cbfV )
751        {
752          m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCr()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V );
753        }
754      }
755    }
756    // transform_unit end
757  }
758}
759
760
761Void TDecEntropy::decodeQP          ( TComDataCU* pcCU, UInt uiAbsPartIdx )
762{
763  if ( pcCU->getSlice()->getPPS()->getUseDQP() )
764  {
765    m_pcEntropyDecoderIf->parseDeltaQP( pcCU, uiAbsPartIdx, pcCU->getDepth( uiAbsPartIdx ) );
766  }
767}
768
769
770/** decode coefficients
771 * \param pcCU
772 * \param uiAbsPartIdx
773 * \param uiDepth
774 * \param uiWidth
775 * \param uiHeight
776 * \returns Void
777 */
778Void TDecEntropy::decodeCoeff( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP )
779{
780  UInt uiMinCoeffSize = pcCU->getPic()->getMinCUWidth()*pcCU->getPic()->getMinCUHeight();
781  UInt uiLumaOffset   = uiMinCoeffSize*uiAbsPartIdx;
782  UInt uiChromaOffset = uiLumaOffset>>2;
783  UInt temp  = 0;
784  UInt temp1 = 0;
785  UInt temp2 = 0;
786 
787#if RWTH_SDC_DLT_B0036
788  if( pcCU->getSDCAvailable(uiAbsPartIdx) && pcCU->getSDCFlag( uiAbsPartIdx ) )
789  {
790    assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
791    assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
792    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
793    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
794    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
795   
796    decodeSDCResidualData(pcCU, uiAbsPartIdx, uiDepth);
797    return;
798  }
799#endif
800 
801  if( pcCU->isIntra(uiAbsPartIdx) )
802  {
803  }
804  else
805  {
806    UInt uiQtRootCbf = 1;
807#if HHI_MPI
808    if( !(pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N &&
809          ( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 || uiDepth == pcCU->getTextureModeDepth( uiAbsPartIdx ) ) ) )
810#else
811    if( !( pcCU->getPartitionSize( uiAbsPartIdx) == SIZE_2Nx2N && pcCU->getMergeFlag( uiAbsPartIdx ) ) )
812#endif
813    {
814      m_pcEntropyDecoderIf->parseQtRootCbf( pcCU, uiAbsPartIdx, uiDepth, uiQtRootCbf );
815    }
816    if ( !uiQtRootCbf )
817    {
818      pcCU->setCbfSubParts( 0, 0, 0, uiAbsPartIdx, uiDepth );
819      pcCU->setTrIdxSubParts( 0 , uiAbsPartIdx, uiDepth );
820      pcCU->setNSQTIdxSubParts( uiAbsPartIdx, uiDepth );
821      return;
822    }
823   
824  }
825
826#if FIX_MPI_B0065
827  if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER && pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getMergeIndex( uiAbsPartIdx ) == 0 && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N &&  pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1  )
828  {
829    TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() );
830    if( uiDepth == pcTextureCU->getDepth(uiAbsPartIdx))
831    {
832      PartSize partSize = pcTextureCU->getPartitionSize(uiAbsPartIdx);
833      pcCU->setPartSizeSubParts( partSize, uiAbsPartIdx, uiDepth );
834    }
835    else
836    {
837      pcCU->setPartSizeSubParts( SIZE_NxN, uiAbsPartIdx, uiDepth );
838    }
839  }
840#endif
841
842  xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, 0, temp, temp1, temp2, bCodeDQP );
843
844#if FIX_MPI_B0065
845  if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER && pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getMergeIndex( uiAbsPartIdx ) == 0 && pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N &&  pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1 )
846  {
847    pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 
848  }
849#endif
850}
851
852#if RWTH_SDC_DLT_B0036
853Void TDecEntropy::decodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
854{
855  assert( pcCU->getSlice()->getSPS()->isDepth() );
856  assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
857 
858  m_pcEntropyDecoderIf->parseSDCPredMode(pcCU, uiAbsPartIdx, uiDepth );
859}
860
861Void TDecEntropy::decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
862{
863  assert( pcCU->getSlice()->getSPS()->isDepth() );
864 
865  m_pcEntropyDecoderIf->parseSDCFlag(pcCU, uiAbsPartIdx, uiDepth );
866}
867
868Void TDecEntropy::decodeSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
869{
870  assert( pcCU->getSlice()->getSPS()->isDepth() );
871  assert( pcCU->getSDCFlag(uiAbsPartIdx) );
872 
873  // number of segments depends on prediction mode for INTRA
874  UInt uiNumSegments = 2;
875  UInt uiLumaPredMode = pcCU->getLumaIntraDir( uiAbsPartIdx );
876  if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTRA && (uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX) )
877    uiNumSegments = 1;
878 
879  // decode residual data for each segment
880  for( UInt uiSeg = 0; uiSeg < uiNumSegments; uiSeg++ )
881    m_pcEntropyDecoderIf->parseSDCResidualData(pcCU, uiAbsPartIdx, uiDepth, uiSeg);
882}
883#endif
884
885//! \}
Note: See TracBrowser for help on using the repository browser.