source: 3DVCSoftware/branches/0.2-HHI/source/Lib/TLibDecoder/TDecSlice.cpp

Last change on this file was 5, checked in by hhi, 13 years ago

Clean version with cfg-files

  • Property svn:eol-style set to native
File size: 3.6 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-2011, 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 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
35
36/** \file     TDecSlice.cpp
37    \brief    slice decoder class
38*/
39
40#include "TDecSlice.h"
41
42//////////////////////////////////////////////////////////////////////
43// Construction/Destruction
44//////////////////////////////////////////////////////////////////////
45
46TDecSlice::TDecSlice()
47{
48}
49
50TDecSlice::~TDecSlice()
51{
52}
53
54Void TDecSlice::create( TComSlice* pcSlice, Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth )
55{
56}
57
58Void TDecSlice::destroy()
59{
60}
61
62Void TDecSlice::init(TDecEntropy* pcEntropyDecoder, TDecCu* pcCuDecoder)
63{
64  m_pcEntropyDecoder  = pcEntropyDecoder;
65  m_pcCuDecoder       = pcCuDecoder;
66}
67
68Void TDecSlice::decompressSlice(TComBitstream* pcBitstream, TComPic*& rpcPic)
69{
70  TComDataCU* pcCU;
71  UInt        uiIsLast = 0;
72  Int   iStartCUAddr = max(rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceCurStartCUAddr(), rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getEntropySliceCurStartCUAddr());
73
74  // decoder don't need prediction & residual frame buffer
75  rpcPic->setPicYuvPred( 0 );
76  rpcPic->setPicYuvResi( 0 );
77 
78#if ENC_DEC_TRACE
79  g_bJustDoIt = g_bEncDecTraceEnable;
80#endif
81  DTRACE_CABAC_V( g_nSymbolCounter++ );
82  DTRACE_CABAC_T( "\tPOC: " );
83  DTRACE_CABAC_V( rpcPic->getPOC() );
84  DTRACE_CABAC_T( "\n" );
85
86#if ENC_DEC_TRACE
87  g_bJustDoIt = g_bEncDecTraceDisable;
88#endif
89
90  // for all CUs in slice
91  UInt  uiLastCUAddr = iStartCUAddr;
92  for( Int iCUAddr = iStartCUAddr; !uiIsLast && iCUAddr < rpcPic->getNumCUsInFrame(); iCUAddr++, uiLastCUAddr++ )
93  {
94    pcCU = rpcPic->getCU( iCUAddr );
95    pcCU->initCU( rpcPic, iCUAddr );
96   
97#if ENC_DEC_TRACE
98    g_bJustDoIt = g_bEncDecTraceEnable;
99#endif
100    m_pcCuDecoder->decodeCU     ( pcCU, uiIsLast );
101    m_pcCuDecoder->decompressCU ( pcCU );
102   
103#if ENC_DEC_TRACE
104    g_bJustDoIt = g_bEncDecTraceDisable;
105#endif
106  }
107
108
109}
Note: See TracBrowser for help on using the repository browser.