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 TDecCu.cpp |
---|
35 | \brief CU decoder class |
---|
36 | */ |
---|
37 | |
---|
38 | #include "TDecCu.h" |
---|
39 | |
---|
40 | #if RWTH_SDC_DLT_B0036 |
---|
41 | #define GetDepthValue2Idx(val) (pcCU->getSlice()->getSPS()->depthValue2idx(val)) |
---|
42 | #define GetIdx2DepthValue(val) (pcCU->getSlice()->getSPS()->idx2DepthValue(val)) |
---|
43 | #endif |
---|
44 | |
---|
45 | //! \ingroup TLibDecoder |
---|
46 | //! \{ |
---|
47 | |
---|
48 | // ==================================================================================================================== |
---|
49 | // Constructor / destructor / create / destroy |
---|
50 | // ==================================================================================================================== |
---|
51 | |
---|
52 | TDecCu::TDecCu() |
---|
53 | { |
---|
54 | m_ppcYuvResi = NULL; |
---|
55 | m_ppcYuvReco = NULL; |
---|
56 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
57 | m_ppcYuvResPred = NULL; |
---|
58 | #endif |
---|
59 | m_ppcCU = NULL; |
---|
60 | } |
---|
61 | |
---|
62 | TDecCu::~TDecCu() |
---|
63 | { |
---|
64 | } |
---|
65 | |
---|
66 | Void TDecCu::init( TDecEntropy* pcEntropyDecoder, TComTrQuant* pcTrQuant, TComPrediction* pcPrediction) |
---|
67 | { |
---|
68 | m_pcEntropyDecoder = pcEntropyDecoder; |
---|
69 | m_pcTrQuant = pcTrQuant; |
---|
70 | m_pcPrediction = pcPrediction; |
---|
71 | } |
---|
72 | |
---|
73 | /** |
---|
74 | \param uiMaxDepth total number of allowable depth |
---|
75 | \param uiMaxWidth largest CU width |
---|
76 | \param uiMaxHeight largest CU height |
---|
77 | */ |
---|
78 | Void TDecCu::create( UInt uiMaxDepth, UInt uiMaxWidth, UInt uiMaxHeight ) |
---|
79 | { |
---|
80 | m_uiMaxDepth = uiMaxDepth+1; |
---|
81 | |
---|
82 | m_ppcYuvResi = new TComYuv*[m_uiMaxDepth-1]; |
---|
83 | m_ppcYuvReco = new TComYuv*[m_uiMaxDepth-1]; |
---|
84 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
85 | m_ppcYuvResPred = new TComYuv* [m_uiMaxDepth-1]; |
---|
86 | #endif |
---|
87 | m_ppcCU = new TComDataCU*[m_uiMaxDepth-1]; |
---|
88 | |
---|
89 | UInt uiNumPartitions; |
---|
90 | for ( UInt ui = 0; ui < m_uiMaxDepth-1; ui++ ) |
---|
91 | { |
---|
92 | uiNumPartitions = 1<<( ( m_uiMaxDepth - ui - 1 )<<1 ); |
---|
93 | UInt uiWidth = uiMaxWidth >> ui; |
---|
94 | UInt uiHeight = uiMaxHeight >> ui; |
---|
95 | |
---|
96 | m_ppcYuvResi[ui] = new TComYuv; m_ppcYuvResi[ui]->create( uiWidth, uiHeight ); |
---|
97 | m_ppcYuvReco[ui] = new TComYuv; m_ppcYuvReco[ui]->create( uiWidth, uiHeight ); |
---|
98 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
99 | m_ppcYuvResPred[ui] = new TComYuv; m_ppcYuvResPred[ui]->create( uiWidth, uiHeight ); |
---|
100 | #endif |
---|
101 | m_ppcCU [ui] = new TComDataCU; m_ppcCU [ui]->create( uiNumPartitions, uiWidth, uiHeight, true, uiMaxWidth >> (m_uiMaxDepth - 1) ); |
---|
102 | } |
---|
103 | |
---|
104 | m_bDecodeDQP = false; |
---|
105 | |
---|
106 | // initialize partition order. |
---|
107 | UInt* piTmp = &g_auiZscanToRaster[0]; |
---|
108 | initZscanToRaster(m_uiMaxDepth, 1, 0, piTmp); |
---|
109 | initRasterToZscan( uiMaxWidth, uiMaxHeight, m_uiMaxDepth ); |
---|
110 | |
---|
111 | // initialize conversion matrix from partition index to pel |
---|
112 | initRasterToPelXY( uiMaxWidth, uiMaxHeight, m_uiMaxDepth ); |
---|
113 | initMotionReferIdx ( uiMaxWidth, uiMaxHeight, m_uiMaxDepth ); |
---|
114 | } |
---|
115 | |
---|
116 | Void TDecCu::destroy() |
---|
117 | { |
---|
118 | for ( UInt ui = 0; ui < m_uiMaxDepth-1; ui++ ) |
---|
119 | { |
---|
120 | m_ppcYuvResi[ui]->destroy(); delete m_ppcYuvResi[ui]; m_ppcYuvResi[ui] = NULL; |
---|
121 | m_ppcYuvReco[ui]->destroy(); delete m_ppcYuvReco[ui]; m_ppcYuvReco[ui] = NULL; |
---|
122 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
123 | m_ppcYuvResPred[ui]->destroy(); delete m_ppcYuvResPred[ui]; m_ppcYuvResPred[ui] = NULL; |
---|
124 | #endif |
---|
125 | m_ppcCU [ui]->destroy(); delete m_ppcCU [ui]; m_ppcCU [ui] = NULL; |
---|
126 | } |
---|
127 | |
---|
128 | delete [] m_ppcYuvResi; m_ppcYuvResi = NULL; |
---|
129 | delete [] m_ppcYuvReco; m_ppcYuvReco = NULL; |
---|
130 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
131 | delete [] m_ppcYuvResPred; m_ppcYuvResPred = NULL; |
---|
132 | #endif |
---|
133 | delete [] m_ppcCU ; m_ppcCU = NULL; |
---|
134 | } |
---|
135 | |
---|
136 | // ==================================================================================================================== |
---|
137 | // Public member functions |
---|
138 | // ==================================================================================================================== |
---|
139 | |
---|
140 | /** \param pcCU pointer of CU data |
---|
141 | \param ruiIsLast last data? |
---|
142 | */ |
---|
143 | Void TDecCu::decodeCU( TComDataCU* pcCU, UInt& ruiIsLast ) |
---|
144 | { |
---|
145 | if ( pcCU->getSlice()->getPPS()->getUseDQP() ) |
---|
146 | { |
---|
147 | setdQPFlag(true); |
---|
148 | } |
---|
149 | |
---|
150 | #if BURST_IPCM |
---|
151 | pcCU->setNumSucIPCM(0); |
---|
152 | #endif |
---|
153 | |
---|
154 | // start from the top level CU |
---|
155 | xDecodeCU( pcCU, 0, 0, ruiIsLast); |
---|
156 | } |
---|
157 | |
---|
158 | /** \param pcCU pointer of CU data |
---|
159 | */ |
---|
160 | Void TDecCu::decompressCU( TComDataCU* pcCU ) |
---|
161 | { |
---|
162 | xDecompressCU( pcCU, pcCU, 0, 0 ); |
---|
163 | } |
---|
164 | |
---|
165 | // ==================================================================================================================== |
---|
166 | // Protected member functions |
---|
167 | // ==================================================================================================================== |
---|
168 | |
---|
169 | /**decode end-of-slice flag |
---|
170 | * \param pcCU |
---|
171 | * \param uiAbsPartIdx |
---|
172 | * \param uiDepth |
---|
173 | * \returns Bool |
---|
174 | */ |
---|
175 | Bool TDecCu::xDecodeSliceEnd( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth) { |
---|
176 | UInt uiIsLast; |
---|
177 | TComPic* pcPic = pcCU->getPic(); |
---|
178 | TComSlice * pcSlice = pcPic->getSlice(pcPic->getCurrSliceIdx()); |
---|
179 | UInt uiCurNumParts = pcPic->getNumPartInCU() >> (uiDepth<<1); |
---|
180 | UInt uiWidth = pcSlice->getSPS()->getPicWidthInLumaSamples(); |
---|
181 | UInt uiHeight = pcSlice->getSPS()->getPicHeightInLumaSamples(); |
---|
182 | UInt uiGranularityWidth = g_uiMaxCUWidth>>(pcSlice->getPPS()->getSliceGranularity()); |
---|
183 | UInt uiPosX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; |
---|
184 | UInt uiPosY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; |
---|
185 | |
---|
186 | #if HHI_MPI |
---|
187 | const UInt uiCUWidth = pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1 ? g_uiMaxCUWidth>>uiDepth : pcCU->getWidth (uiAbsPartIdx); |
---|
188 | const UInt uiCUHeight = pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1 ? g_uiMaxCUHeight>>uiDepth : pcCU->getHeight(uiAbsPartIdx); |
---|
189 | if(((uiPosX+uiCUWidth)%uiGranularityWidth==0||(uiPosX+uiCUWidth==uiWidth)) |
---|
190 | &&((uiPosY+uiCUHeight)%uiGranularityWidth==0||(uiPosY+uiCUHeight==uiHeight))) |
---|
191 | #else |
---|
192 | if(((uiPosX+pcCU->getWidth(uiAbsPartIdx))%uiGranularityWidth==0||(uiPosX+pcCU->getWidth(uiAbsPartIdx)==uiWidth)) |
---|
193 | &&((uiPosY+pcCU->getHeight(uiAbsPartIdx))%uiGranularityWidth==0||(uiPosY+pcCU->getHeight(uiAbsPartIdx)==uiHeight))) |
---|
194 | #endif |
---|
195 | { |
---|
196 | m_pcEntropyDecoder->decodeTerminatingBit( uiIsLast ); |
---|
197 | } |
---|
198 | else |
---|
199 | { |
---|
200 | uiIsLast=0; |
---|
201 | } |
---|
202 | |
---|
203 | if(uiIsLast) |
---|
204 | { |
---|
205 | if(pcSlice->isNextEntropySlice()&&!pcSlice->isNextSlice()) |
---|
206 | { |
---|
207 | pcSlice->setEntropySliceCurEndCUAddr(pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts); |
---|
208 | } |
---|
209 | else |
---|
210 | { |
---|
211 | pcSlice->setSliceCurEndCUAddr(pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts); |
---|
212 | pcSlice->setEntropySliceCurEndCUAddr(pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts); |
---|
213 | } |
---|
214 | } |
---|
215 | |
---|
216 | return uiIsLast>0; |
---|
217 | } |
---|
218 | |
---|
219 | /** decode CU block recursively |
---|
220 | * \param pcCU |
---|
221 | * \param uiAbsPartIdx |
---|
222 | * \param uiDepth |
---|
223 | * \returns Void |
---|
224 | */ |
---|
225 | |
---|
226 | Void TDecCu::xDecodeCU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt& ruiIsLast) |
---|
227 | { |
---|
228 | TComPic* pcPic = pcCU->getPic(); |
---|
229 | UInt uiCurNumParts = pcPic->getNumPartInCU() >> (uiDepth<<1); |
---|
230 | UInt uiQNumParts = uiCurNumParts>>2; |
---|
231 | |
---|
232 | Bool bBoundary = false; |
---|
233 | UInt uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; |
---|
234 | UInt uiRPelX = uiLPelX + (g_uiMaxCUWidth>>uiDepth) - 1; |
---|
235 | UInt uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; |
---|
236 | UInt uiBPelY = uiTPelY + (g_uiMaxCUHeight>>uiDepth) - 1; |
---|
237 | |
---|
238 | TComSlice * pcSlice = pcCU->getPic()->getSlice(pcCU->getPic()->getCurrSliceIdx()); |
---|
239 | Bool bStartInCU = pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts>pcSlice->getEntropySliceCurStartCUAddr()&&pcCU->getSCUAddr()+uiAbsPartIdx<pcSlice->getEntropySliceCurStartCUAddr(); |
---|
240 | if((!bStartInCU) && ( uiRPelX < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( uiBPelY < pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) |
---|
241 | { |
---|
242 | #if BURST_IPCM |
---|
243 | if(pcCU->getNumSucIPCM() == 0) |
---|
244 | { |
---|
245 | #if HHI_MPI |
---|
246 | if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 || uiDepth < pcCU->getTextureModeDepth( uiAbsPartIdx ) ) |
---|
247 | #endif |
---|
248 | m_pcEntropyDecoder->decodeSplitFlag( pcCU, uiAbsPartIdx, uiDepth ); |
---|
249 | } |
---|
250 | else |
---|
251 | { |
---|
252 | pcCU->setDepthSubParts( uiDepth, uiAbsPartIdx ); |
---|
253 | } |
---|
254 | #else |
---|
255 | #if HHI_MPI |
---|
256 | if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 || uiDepth < pcCU->getTextureModeDepth( uiAbsPartIdx ) ) |
---|
257 | #endif |
---|
258 | m_pcEntropyDecoder->decodeSplitFlag( pcCU, uiAbsPartIdx, uiDepth ); |
---|
259 | #endif |
---|
260 | } |
---|
261 | else |
---|
262 | { |
---|
263 | bBoundary = true; |
---|
264 | } |
---|
265 | |
---|
266 | if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth ) ) || bBoundary ) |
---|
267 | { |
---|
268 | UInt uiIdx = uiAbsPartIdx; |
---|
269 | if( (g_uiMaxCUWidth>>uiDepth) == pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP()) |
---|
270 | { |
---|
271 | setdQPFlag(true); |
---|
272 | pcCU->setQPSubParts( pcCU->getRefQP(uiAbsPartIdx), uiAbsPartIdx, uiDepth ); // set QP to default QP |
---|
273 | } |
---|
274 | |
---|
275 | for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++ ) |
---|
276 | { |
---|
277 | uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiIdx] ]; |
---|
278 | uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiIdx] ]; |
---|
279 | |
---|
280 | Bool bSubInSlice = pcCU->getSCUAddr()+uiIdx+uiQNumParts>pcSlice->getEntropySliceCurStartCUAddr(); |
---|
281 | if ( bSubInSlice ) |
---|
282 | { |
---|
283 | if ( ( uiLPelX < pcCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ) ) |
---|
284 | { |
---|
285 | xDecodeCU( pcCU, uiIdx, uiDepth+1, ruiIsLast ); |
---|
286 | } |
---|
287 | else |
---|
288 | { |
---|
289 | pcCU->setOutsideCUPart( uiIdx, uiDepth+1 ); |
---|
290 | } |
---|
291 | } |
---|
292 | if(ruiIsLast) |
---|
293 | { |
---|
294 | break; |
---|
295 | } |
---|
296 | |
---|
297 | uiIdx += uiQNumParts; |
---|
298 | } |
---|
299 | if( (g_uiMaxCUWidth>>uiDepth) == pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP()) |
---|
300 | { |
---|
301 | if ( getdQPFlag() ) |
---|
302 | { |
---|
303 | UInt uiQPSrcPartIdx; |
---|
304 | if ( pcPic->getCU( pcCU->getAddr() )->getEntropySliceStartCU(uiAbsPartIdx) != pcSlice->getEntropySliceCurStartCUAddr() ) |
---|
305 | { |
---|
306 | uiQPSrcPartIdx = pcSlice->getEntropySliceCurStartCUAddr() % pcPic->getNumPartInCU(); |
---|
307 | } |
---|
308 | else |
---|
309 | { |
---|
310 | uiQPSrcPartIdx = uiAbsPartIdx; |
---|
311 | } |
---|
312 | pcCU->setQPSubParts( pcCU->getRefQP( uiQPSrcPartIdx ), uiAbsPartIdx, uiDepth ); // set QP to default QP |
---|
313 | } |
---|
314 | } |
---|
315 | return; |
---|
316 | } |
---|
317 | |
---|
318 | if( (g_uiMaxCUWidth>>uiDepth) >= pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP()) |
---|
319 | { |
---|
320 | setdQPFlag(true); |
---|
321 | pcCU->setQPSubParts( pcCU->getRefQP(uiAbsPartIdx), uiAbsPartIdx, uiDepth ); // set QP to default QP |
---|
322 | } |
---|
323 | |
---|
324 | // decode CU mode and the partition size |
---|
325 | #if BURST_IPCM |
---|
326 | if( !pcCU->getSlice()->isIntra() && pcCU->getNumSucIPCM() == 0 ) |
---|
327 | #else |
---|
328 | if( !pcCU->getSlice()->isIntra() ) |
---|
329 | #endif |
---|
330 | #if HHI_MPI |
---|
331 | if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 ) |
---|
332 | #endif |
---|
333 | { |
---|
334 | m_pcEntropyDecoder->decodeSkipFlag( pcCU, uiAbsPartIdx, uiDepth ); |
---|
335 | } |
---|
336 | |
---|
337 | if( pcCU->isSkipped(uiAbsPartIdx) ) |
---|
338 | { |
---|
339 | m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 ); |
---|
340 | m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 ); |
---|
341 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
342 | TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists |
---|
343 | UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; |
---|
344 | Int numValidMergeCand = 0; |
---|
345 | for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS_MEM; ++ui ) |
---|
346 | #else |
---|
347 | TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists |
---|
348 | UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS]; |
---|
349 | Int numValidMergeCand = 0; |
---|
350 | for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ++ui ) |
---|
351 | #endif |
---|
352 | { |
---|
353 | uhInterDirNeighbours[ui] = 0; |
---|
354 | } |
---|
355 | m_pcEntropyDecoder->decodeMergeIndex( pcCU, 0, uiAbsPartIdx, SIZE_2Nx2N, uhInterDirNeighbours, cMvFieldNeighbours, uiDepth ); |
---|
356 | #if HHI_MPI |
---|
357 | if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == uiDepth ) |
---|
358 | { |
---|
359 | TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ); |
---|
360 | pcCU->copyTextureMotionDataFrom( pcTextureCU, uiDepth, pcCU->getZorderIdxInCU() + uiAbsPartIdx, uiAbsPartIdx ); |
---|
361 | |
---|
362 | UInt uiCurrPartNumb = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); |
---|
363 | for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) |
---|
364 | { |
---|
365 | const UChar uhNewDepth = max<UInt>( uiDepth, pcTextureCU->getDepth( uiAbsPartIdx + ui ) ); |
---|
366 | pcCU->setPredictionMode( uiAbsPartIdx + ui, MODE_SKIP ); |
---|
367 | pcCU->setPartitionSize( uiAbsPartIdx + ui, SIZE_2Nx2N ); |
---|
368 | pcCU->setDepth( uiAbsPartIdx + ui, uhNewDepth ); |
---|
369 | pcCU->setWidth( uiAbsPartIdx + ui, g_uiMaxCUWidth>>uhNewDepth ); |
---|
370 | pcCU->setHeight( uiAbsPartIdx + ui, g_uiMaxCUHeight>>uhNewDepth ); |
---|
371 | } |
---|
372 | #if LGE_ILLUCOMP_DEPTH_C0046 |
---|
373 | m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); |
---|
374 | #endif |
---|
375 | } |
---|
376 | else |
---|
377 | { |
---|
378 | #endif |
---|
379 | #if SIMP_MRG_PRUN |
---|
380 | UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx); |
---|
381 | m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); |
---|
382 | #else |
---|
383 | m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); |
---|
384 | UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx); |
---|
385 | #endif |
---|
386 | pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); |
---|
387 | |
---|
388 | TComMv cTmpMv( 0, 0 ); |
---|
389 | for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) |
---|
390 | { |
---|
391 | if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 ) |
---|
392 | { |
---|
393 | pcCU->setMVPIdxSubParts( 0, RefPicList( uiRefListIdx ), uiAbsPartIdx, 0, uiDepth); |
---|
394 | pcCU->setMVPNumSubParts( 0, RefPicList( uiRefListIdx ), uiAbsPartIdx, 0, uiDepth); |
---|
395 | pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); |
---|
396 | pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); |
---|
397 | } |
---|
398 | } |
---|
399 | #if LGE_ILLUCOMP_B0045 |
---|
400 | m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); |
---|
401 | #endif |
---|
402 | #if HHI_MPI |
---|
403 | } |
---|
404 | #endif |
---|
405 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
406 | m_pcEntropyDecoder->decodeResPredFlag( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth], 0 ); |
---|
407 | #endif |
---|
408 | xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast ); |
---|
409 | return; |
---|
410 | } |
---|
411 | |
---|
412 | #if HHI_MPI |
---|
413 | if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 ) |
---|
414 | { |
---|
415 | #endif |
---|
416 | #if BURST_IPCM |
---|
417 | if( pcCU->getNumSucIPCM() == 0 ) |
---|
418 | { |
---|
419 | m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth ); |
---|
420 | m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth ); |
---|
421 | } |
---|
422 | else |
---|
423 | { |
---|
424 | pcCU->setPredModeSubParts( MODE_INTRA, uiAbsPartIdx, uiDepth ); |
---|
425 | pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); |
---|
426 | pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth ); |
---|
427 | pcCU->setTrIdxSubParts( 0, uiAbsPartIdx, uiDepth ); |
---|
428 | } |
---|
429 | #else |
---|
430 | m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth ); |
---|
431 | m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth ); |
---|
432 | #endif |
---|
433 | |
---|
434 | if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) |
---|
435 | { |
---|
436 | m_pcEntropyDecoder->decodeIPCMInfo( pcCU, uiAbsPartIdx, uiDepth ); |
---|
437 | |
---|
438 | if(pcCU->getIPCMFlag(uiAbsPartIdx)) |
---|
439 | { |
---|
440 | xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast ); |
---|
441 | return; |
---|
442 | } |
---|
443 | } |
---|
444 | |
---|
445 | #if ! HHI_MPI |
---|
446 | UInt uiCurrWidth = pcCU->getWidth ( uiAbsPartIdx ); |
---|
447 | UInt uiCurrHeight = pcCU->getHeight( uiAbsPartIdx ); |
---|
448 | #endif |
---|
449 | |
---|
450 | // prediction mode ( Intra : direction mode, Inter : Mv, reference idx ) |
---|
451 | m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]); |
---|
452 | |
---|
453 | #if LGE_ILLUCOMP_B0045 |
---|
454 | #if LGE_ILLUCOMP_DEPTH_C0046 |
---|
455 | if( pcCU->getTextureModeDepth( uiAbsPartIdx ) != uiDepth ) |
---|
456 | { |
---|
457 | #endif |
---|
458 | m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); |
---|
459 | #endif |
---|
460 | |
---|
461 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
462 | if( !pcCU->isIntra( uiAbsPartIdx ) ) |
---|
463 | { |
---|
464 | m_pcEntropyDecoder->decodeResPredFlag ( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth], 0 ); |
---|
465 | } |
---|
466 | #endif |
---|
467 | #if LGE_ILLUCOMP_DEPTH_C0046 |
---|
468 | } |
---|
469 | #endif |
---|
470 | |
---|
471 | #if HHI_MPI |
---|
472 | if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == uiDepth ) |
---|
473 | { |
---|
474 | assert( pcCU->getZorderIdxInCU() == 0 ); |
---|
475 | TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ); |
---|
476 | pcCU->copyTextureMotionDataFrom( pcTextureCU, uiDepth, pcCU->getZorderIdxInCU() + uiAbsPartIdx, uiAbsPartIdx ); |
---|
477 | |
---|
478 | UInt uiCurrPartNumb = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); |
---|
479 | for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) |
---|
480 | { |
---|
481 | const UChar uhNewDepth = max<UInt>( uiDepth, pcTextureCU->getDepth( uiAbsPartIdx + ui ) ); |
---|
482 | pcCU->setPredictionMode( uiAbsPartIdx + ui, MODE_INTER ); |
---|
483 | pcCU->setPartitionSize( uiAbsPartIdx + ui, SIZE_2Nx2N ); |
---|
484 | pcCU->setDepth( uiAbsPartIdx + ui, uhNewDepth ); |
---|
485 | pcCU->setWidth( uiAbsPartIdx + ui, g_uiMaxCUWidth>>uhNewDepth ); |
---|
486 | pcCU->setHeight( uiAbsPartIdx + ui, g_uiMaxCUHeight>>uhNewDepth ); |
---|
487 | } |
---|
488 | #if LGE_ILLUCOMP_DEPTH_C0046 |
---|
489 | m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); |
---|
490 | #endif |
---|
491 | if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth ) ) || bBoundary ) |
---|
492 | { |
---|
493 | UInt uiIdx = uiAbsPartIdx; |
---|
494 | if( (g_uiMaxCUWidth>>uiDepth) == pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP()) |
---|
495 | { |
---|
496 | setdQPFlag(true); |
---|
497 | pcCU->setQPSubParts( pcCU->getRefQP(uiAbsPartIdx), uiAbsPartIdx, uiDepth ); // set QP to default QP |
---|
498 | } |
---|
499 | |
---|
500 | for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++ ) |
---|
501 | { |
---|
502 | uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiIdx] ]; |
---|
503 | uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiIdx] ]; |
---|
504 | |
---|
505 | Bool bSubInSlice = pcCU->getSCUAddr()+uiIdx+uiQNumParts>pcSlice->getEntropySliceCurStartCUAddr(); |
---|
506 | if ( bSubInSlice ) |
---|
507 | { |
---|
508 | if ( ( uiLPelX < pcCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ) ) |
---|
509 | { |
---|
510 | xDecodeCU( pcCU, uiIdx, uiDepth+1, ruiIsLast ); |
---|
511 | } |
---|
512 | else |
---|
513 | { |
---|
514 | pcCU->setOutsideCUPart( uiIdx, uiDepth+1 ); |
---|
515 | } |
---|
516 | } |
---|
517 | if(ruiIsLast) |
---|
518 | { |
---|
519 | break; |
---|
520 | } |
---|
521 | uiIdx += uiQNumParts; |
---|
522 | } |
---|
523 | if( (g_uiMaxCUWidth>>uiDepth) == pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP()) |
---|
524 | { |
---|
525 | if ( getdQPFlag() ) |
---|
526 | { |
---|
527 | UInt uiQPSrcPartIdx; |
---|
528 | if ( pcPic->getCU( pcCU->getAddr() )->getEntropySliceStartCU(uiAbsPartIdx) != pcSlice->getEntropySliceCurStartCUAddr() ) |
---|
529 | { |
---|
530 | uiQPSrcPartIdx = pcSlice->getEntropySliceCurStartCUAddr() % pcPic->getNumPartInCU(); |
---|
531 | } |
---|
532 | else |
---|
533 | { |
---|
534 | uiQPSrcPartIdx = uiAbsPartIdx; |
---|
535 | } |
---|
536 | pcCU->setQPSubParts( pcCU->getRefQP( uiQPSrcPartIdx ), uiAbsPartIdx, uiDepth ); // set QP to default QP |
---|
537 | } |
---|
538 | } |
---|
539 | return; |
---|
540 | } |
---|
541 | } |
---|
542 | } |
---|
543 | |
---|
544 | UInt uiCurrWidth = pcCU->getWidth ( uiAbsPartIdx ); |
---|
545 | UInt uiCurrHeight = pcCU->getHeight( uiAbsPartIdx ); |
---|
546 | #endif |
---|
547 | |
---|
548 | // Coefficient decoding |
---|
549 | Bool bCodeDQP = getdQPFlag(); |
---|
550 | m_pcEntropyDecoder->decodeCoeff( pcCU, uiAbsPartIdx, uiDepth, uiCurrWidth, uiCurrHeight, bCodeDQP ); |
---|
551 | setdQPFlag( bCodeDQP ); |
---|
552 | xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast ); |
---|
553 | } |
---|
554 | |
---|
555 | Void TDecCu::xFinishDecodeCU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt& ruiIsLast) |
---|
556 | { |
---|
557 | if( (g_uiMaxCUWidth>>uiDepth) >= pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP()) |
---|
558 | { |
---|
559 | if( getdQPFlag() ) |
---|
560 | { |
---|
561 | pcCU->setQPSubParts( pcCU->getRefQP(uiAbsPartIdx), uiAbsPartIdx, uiDepth ); // set QP to default QP |
---|
562 | } |
---|
563 | } |
---|
564 | |
---|
565 | #if BURST_IPCM |
---|
566 | if( pcCU->getNumSucIPCM() > 0 ) |
---|
567 | { |
---|
568 | ruiIsLast = 0; |
---|
569 | return; |
---|
570 | } |
---|
571 | #endif |
---|
572 | |
---|
573 | ruiIsLast = xDecodeSliceEnd( pcCU, uiAbsPartIdx, uiDepth); |
---|
574 | } |
---|
575 | |
---|
576 | Void TDecCu::xDecompressCU( TComDataCU* pcCU, TComDataCU* pcCUCur, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
577 | { |
---|
578 | TComPic* pcPic = pcCU->getPic(); |
---|
579 | |
---|
580 | Bool bBoundary = false; |
---|
581 | UInt uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; |
---|
582 | UInt uiRPelX = uiLPelX + (g_uiMaxCUWidth>>uiDepth) - 1; |
---|
583 | UInt uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; |
---|
584 | UInt uiBPelY = uiTPelY + (g_uiMaxCUHeight>>uiDepth) - 1; |
---|
585 | |
---|
586 | UInt uiCurNumParts = pcPic->getNumPartInCU() >> (uiDepth<<1); |
---|
587 | TComSlice * pcSlice = pcCU->getPic()->getSlice(pcCU->getPic()->getCurrSliceIdx()); |
---|
588 | Bool bStartInCU = pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts>pcSlice->getEntropySliceCurStartCUAddr()&&pcCU->getSCUAddr()+uiAbsPartIdx<pcSlice->getEntropySliceCurStartCUAddr(); |
---|
589 | if(bStartInCU||( uiRPelX >= pcSlice->getSPS()->getPicWidthInLumaSamples() ) || ( uiBPelY >= pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) |
---|
590 | { |
---|
591 | bBoundary = true; |
---|
592 | } |
---|
593 | |
---|
594 | if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth ) ) || bBoundary ) |
---|
595 | { |
---|
596 | UInt uiNextDepth = uiDepth + 1; |
---|
597 | UInt uiQNumParts = pcCU->getTotalNumPart() >> (uiNextDepth<<1); |
---|
598 | UInt uiIdx = uiAbsPartIdx; |
---|
599 | for ( UInt uiPartIdx = 0; uiPartIdx < 4; uiPartIdx++ ) |
---|
600 | { |
---|
601 | uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiIdx] ]; |
---|
602 | uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiIdx] ]; |
---|
603 | |
---|
604 | Bool binSlice = (pcCU->getSCUAddr()+uiIdx+uiQNumParts>pcSlice->getEntropySliceCurStartCUAddr())&&(pcCU->getSCUAddr()+uiIdx<pcSlice->getEntropySliceCurEndCUAddr()); |
---|
605 | if(binSlice&&( uiLPelX < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) |
---|
606 | { |
---|
607 | xDecompressCU(pcCU, m_ppcCU[uiNextDepth], uiIdx, uiNextDepth ); |
---|
608 | } |
---|
609 | |
---|
610 | uiIdx += uiQNumParts; |
---|
611 | } |
---|
612 | return; |
---|
613 | } |
---|
614 | |
---|
615 | // Residual reconstruction |
---|
616 | m_ppcYuvResi[uiDepth]->clear(); |
---|
617 | |
---|
618 | m_ppcCU[uiDepth]->copySubCU( pcCU, uiAbsPartIdx, uiDepth ); |
---|
619 | |
---|
620 | switch( m_ppcCU[uiDepth]->getPredictionMode(0) ) |
---|
621 | { |
---|
622 | case MODE_SKIP: |
---|
623 | case MODE_INTER: |
---|
624 | xReconInter( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); |
---|
625 | break; |
---|
626 | case MODE_INTRA: |
---|
627 | #if RWTH_SDC_DLT_B0036 |
---|
628 | if( m_ppcCU[uiDepth]->getSDCFlag(0) ) |
---|
629 | xReconIntraSDC( m_ppcCU[uiDepth], 0, uiDepth ); |
---|
630 | else |
---|
631 | #endif |
---|
632 | xReconIntraQT( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); |
---|
633 | break; |
---|
634 | default: |
---|
635 | assert(0); |
---|
636 | break; |
---|
637 | } |
---|
638 | #if LOSSLESS_CODING |
---|
639 | if ( m_ppcCU[uiDepth]->isLosslessCoded(0) && (m_ppcCU[uiDepth]->getIPCMFlag(0) == false)) |
---|
640 | { |
---|
641 | xFillPCMBuffer(m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth); |
---|
642 | } |
---|
643 | #endif |
---|
644 | |
---|
645 | xCopyToPic( m_ppcCU[uiDepth], pcPic, uiAbsPartIdx, uiDepth ); |
---|
646 | } |
---|
647 | |
---|
648 | Void TDecCu::xReconInter( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
649 | { |
---|
650 | #if HHI_MPI |
---|
651 | #if FIX_MPI_B0065 |
---|
652 | if( pcCU->getTextureModeDepth( 0 ) != -1 ) |
---|
653 | { |
---|
654 | TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ); |
---|
655 | if( uiDepth == pcTextureCU->getDepth(uiAbsPartIdx)) |
---|
656 | { |
---|
657 | PartSize partSize = pcTextureCU->getPartitionSize(uiAbsPartIdx); |
---|
658 | pcCU->setPartSizeSubParts( partSize, 0, uiDepth ); |
---|
659 | } |
---|
660 | else |
---|
661 | { |
---|
662 | pcCU->setPartSizeSubParts( SIZE_NxN, 0, uiDepth ); |
---|
663 | } |
---|
664 | } |
---|
665 | #else |
---|
666 | if( pcCU->getTextureModeDepth( 0 ) != -1 ) |
---|
667 | pcCU->setPartSizeSubParts( SIZE_NxN, 0, uiDepth ); |
---|
668 | #endif |
---|
669 | #endif |
---|
670 | |
---|
671 | // inter prediction |
---|
672 | m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] ); |
---|
673 | |
---|
674 | #if HHI_MPI |
---|
675 | if( pcCU->getTextureModeDepth( 0 ) != -1 ) |
---|
676 | pcCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); |
---|
677 | #endif |
---|
678 | |
---|
679 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
680 | if( pcCU->getResPredFlag( 0 ) ) |
---|
681 | { |
---|
682 | AOF( pcCU->getResPredAvail( 0 ) ); |
---|
683 | Bool bOK = pcCU->getResidualSamples( 0, |
---|
684 | #if QC_SIMPLIFIEDIVRP_M24938 |
---|
685 | true, |
---|
686 | #endif |
---|
687 | m_ppcYuvResPred[uiDepth] ); |
---|
688 | AOF( bOK ); |
---|
689 | #if LG_RESTRICTEDRESPRED_M24766 |
---|
690 | Int iPUResiPredShift[4]; |
---|
691 | pcCU->getPUResiPredShift(iPUResiPredShift, 0); |
---|
692 | m_ppcYuvReco[uiDepth]->add(iPUResiPredShift, pcCU->getPartitionSize(0), m_ppcYuvResPred[uiDepth], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) ); |
---|
693 | #else |
---|
694 | m_ppcYuvReco[uiDepth]->add( m_ppcYuvResPred[uiDepth], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) ); |
---|
695 | #endif |
---|
696 | } |
---|
697 | #endif |
---|
698 | |
---|
699 | // inter recon |
---|
700 | xDecodeInterTexture( pcCU, 0, uiDepth ); |
---|
701 | |
---|
702 | // clip for only non-zero cbp case |
---|
703 | if ( ( pcCU->getCbf( 0, TEXT_LUMA ) ) || ( pcCU->getCbf( 0, TEXT_CHROMA_U ) ) || ( pcCU->getCbf(0, TEXT_CHROMA_V ) ) ) |
---|
704 | { |
---|
705 | m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ) ); |
---|
706 | } |
---|
707 | else |
---|
708 | { |
---|
709 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
710 | if( pcCU->getResPredFlag( 0 ) ) |
---|
711 | { |
---|
712 | m_ppcYuvReco[uiDepth]->clip( pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) ); |
---|
713 | } |
---|
714 | #endif |
---|
715 | m_ppcYuvReco[uiDepth]->copyPartToPartYuv( m_ppcYuvReco[uiDepth],0, pcCU->getWidth( 0 ),pcCU->getHeight( 0 )); |
---|
716 | } |
---|
717 | } |
---|
718 | |
---|
719 | Void |
---|
720 | TDecCu::xIntraRecLumaBlk( TComDataCU* pcCU, |
---|
721 | UInt uiTrDepth, |
---|
722 | UInt uiAbsPartIdx, |
---|
723 | TComYuv* pcRecoYuv, |
---|
724 | TComYuv* pcPredYuv, |
---|
725 | TComYuv* pcResiYuv ) |
---|
726 | { |
---|
727 | UInt uiWidth = pcCU ->getWidth ( 0 ) >> uiTrDepth; |
---|
728 | UInt uiHeight = pcCU ->getHeight ( 0 ) >> uiTrDepth; |
---|
729 | UInt uiStride = pcRecoYuv->getStride (); |
---|
730 | Pel* piReco = pcRecoYuv->getLumaAddr( uiAbsPartIdx ); |
---|
731 | Pel* piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); |
---|
732 | Pel* piResi = pcResiYuv->getLumaAddr( uiAbsPartIdx ); |
---|
733 | |
---|
734 | UInt uiNumCoeffInc = ( pcCU->getSlice()->getSPS()->getMaxCUWidth() * pcCU->getSlice()->getSPS()->getMaxCUHeight() ) >> ( pcCU->getSlice()->getSPS()->getMaxCUDepth() << 1 ); |
---|
735 | TCoeff* pcCoeff = pcCU->getCoeffY() + ( uiNumCoeffInc * uiAbsPartIdx ); |
---|
736 | |
---|
737 | UInt uiLumaPredMode = pcCU->getLumaIntraDir ( uiAbsPartIdx ); |
---|
738 | |
---|
739 | UInt uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx; |
---|
740 | Pel* piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); |
---|
741 | UInt uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); |
---|
742 | |
---|
743 | //===== init availability pattern ===== |
---|
744 | Bool bAboveAvail = false; |
---|
745 | Bool bLeftAvail = false; |
---|
746 | pcCU->getPattern()->initPattern ( pcCU, uiTrDepth, uiAbsPartIdx ); |
---|
747 | pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, uiTrDepth, |
---|
748 | m_pcPrediction->getPredicBuf (), |
---|
749 | m_pcPrediction->getPredicBufWidth (), |
---|
750 | m_pcPrediction->getPredicBufHeight (), |
---|
751 | bAboveAvail, bLeftAvail ); |
---|
752 | #if LGE_EDGE_INTRA_A0070 |
---|
753 | if( uiLumaPredMode >= EDGE_INTRA_IDX ) |
---|
754 | { |
---|
755 | m_pcPrediction->predIntraLumaEdge( pcCU, pcCU->getPattern(), uiAbsPartIdx, uiWidth, uiHeight, piPred, uiStride |
---|
756 | #if LGE_EDGE_INTRA_DELTA_DC |
---|
757 | , uiLumaPredMode == EDGE_INTRA_DELTA_IDX |
---|
758 | #endif |
---|
759 | ); |
---|
760 | } |
---|
761 | else |
---|
762 | #endif |
---|
763 | |
---|
764 | //===== get prediction signal ===== |
---|
765 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
766 | if( uiLumaPredMode >= NUM_INTRA_MODE ) |
---|
767 | { |
---|
768 | m_pcPrediction->predIntraLumaDMM( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail, false ); |
---|
769 | } |
---|
770 | else |
---|
771 | { |
---|
772 | #endif |
---|
773 | m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, pcCU, bAboveAvail, bLeftAvail ); |
---|
774 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
775 | } |
---|
776 | #endif |
---|
777 | |
---|
778 | //===== inverse transform ===== |
---|
779 | #if H0736_AVC_STYLE_QP_RANGE |
---|
780 | m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 ); |
---|
781 | #else |
---|
782 | m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA, 0 ); |
---|
783 | #endif |
---|
784 | |
---|
785 | Int scalingListType = (pcCU->isIntra(uiAbsPartIdx) ? 0 : 3) + g_eTTable[(Int)TEXT_LUMA]; |
---|
786 | assert(scalingListType < 6); |
---|
787 | #if LOSSLESS_CODING |
---|
788 | m_pcTrQuant->invtransformNxN( pcCU, TEXT_LUMA, pcCU->getLumaIntraDir( uiAbsPartIdx ), piResi, uiStride, pcCoeff, uiWidth, uiHeight, scalingListType ); |
---|
789 | #else |
---|
790 | m_pcTrQuant->invtransformNxN( TEXT_LUMA, pcCU->getLumaIntraDir( uiAbsPartIdx ), piResi, uiStride, pcCoeff, uiWidth, uiHeight, scalingListType ); |
---|
791 | #endif |
---|
792 | |
---|
793 | |
---|
794 | //===== reconstruction ===== |
---|
795 | Pel* pPred = piPred; |
---|
796 | Pel* pResi = piResi; |
---|
797 | Pel* pReco = piReco; |
---|
798 | Pel* pRecIPred = piRecIPred; |
---|
799 | for( UInt uiY = 0; uiY < uiHeight; uiY++ ) |
---|
800 | { |
---|
801 | for( UInt uiX = 0; uiX < uiWidth; uiX++ ) |
---|
802 | { |
---|
803 | pReco [ uiX ] = Clip( pPred[ uiX ] + pResi[ uiX ] ); |
---|
804 | pRecIPred[ uiX ] = pReco[ uiX ]; |
---|
805 | } |
---|
806 | pPred += uiStride; |
---|
807 | pResi += uiStride; |
---|
808 | pReco += uiStride; |
---|
809 | pRecIPred += uiRecIPredStride; |
---|
810 | } |
---|
811 | } |
---|
812 | |
---|
813 | |
---|
814 | Void |
---|
815 | TDecCu::xIntraRecChromaBlk( TComDataCU* pcCU, |
---|
816 | UInt uiTrDepth, |
---|
817 | UInt uiAbsPartIdx, |
---|
818 | TComYuv* pcRecoYuv, |
---|
819 | TComYuv* pcPredYuv, |
---|
820 | TComYuv* pcResiYuv, |
---|
821 | UInt uiChromaId ) |
---|
822 | { |
---|
823 | UInt uiFullDepth = pcCU->getDepth( 0 ) + uiTrDepth; |
---|
824 | UInt uiLog2TrSize = g_aucConvertToBit[ pcCU->getSlice()->getSPS()->getMaxCUWidth() >> uiFullDepth ] + 2; |
---|
825 | |
---|
826 | if( uiLog2TrSize == 2 ) |
---|
827 | { |
---|
828 | assert( uiTrDepth > 0 ); |
---|
829 | uiTrDepth--; |
---|
830 | UInt uiQPDiv = pcCU->getPic()->getNumPartInCU() >> ( ( pcCU->getDepth( 0 ) + uiTrDepth ) << 1 ); |
---|
831 | Bool bFirstQ = ( ( uiAbsPartIdx % uiQPDiv ) == 0 ); |
---|
832 | if( !bFirstQ ) |
---|
833 | { |
---|
834 | return; |
---|
835 | } |
---|
836 | } |
---|
837 | |
---|
838 | TextType eText = ( uiChromaId > 0 ? TEXT_CHROMA_V : TEXT_CHROMA_U ); |
---|
839 | UInt uiWidth = pcCU ->getWidth ( 0 ) >> ( uiTrDepth + 1 ); |
---|
840 | UInt uiHeight = pcCU ->getHeight ( 0 ) >> ( uiTrDepth + 1 ); |
---|
841 | UInt uiStride = pcRecoYuv->getCStride (); |
---|
842 | Pel* piReco = ( uiChromaId > 0 ? pcRecoYuv->getCrAddr( uiAbsPartIdx ) : pcRecoYuv->getCbAddr( uiAbsPartIdx ) ); |
---|
843 | Pel* piPred = ( uiChromaId > 0 ? pcPredYuv->getCrAddr( uiAbsPartIdx ) : pcPredYuv->getCbAddr( uiAbsPartIdx ) ); |
---|
844 | Pel* piResi = ( uiChromaId > 0 ? pcResiYuv->getCrAddr( uiAbsPartIdx ) : pcResiYuv->getCbAddr( uiAbsPartIdx ) ); |
---|
845 | |
---|
846 | UInt uiNumCoeffInc = ( ( pcCU->getSlice()->getSPS()->getMaxCUWidth() * pcCU->getSlice()->getSPS()->getMaxCUHeight() ) >> ( pcCU->getSlice()->getSPS()->getMaxCUDepth() << 1 ) ) >> 2; |
---|
847 | TCoeff* pcCoeff = ( uiChromaId > 0 ? pcCU->getCoeffCr() : pcCU->getCoeffCb() ) + ( uiNumCoeffInc * uiAbsPartIdx ); |
---|
848 | |
---|
849 | UInt uiChromaPredMode = pcCU->getChromaIntraDir( 0 ); |
---|
850 | |
---|
851 | UInt uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx; |
---|
852 | Pel* piRecIPred = ( uiChromaId > 0 ? pcCU->getPic()->getPicYuvRec()->getCrAddr( pcCU->getAddr(), uiZOrder ) : pcCU->getPic()->getPicYuvRec()->getCbAddr( pcCU->getAddr(), uiZOrder ) ); |
---|
853 | UInt uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getCStride(); |
---|
854 | |
---|
855 | //===== init availability pattern ===== |
---|
856 | Bool bAboveAvail = false; |
---|
857 | Bool bLeftAvail = false; |
---|
858 | pcCU->getPattern()->initPattern ( pcCU, uiTrDepth, uiAbsPartIdx ); |
---|
859 | |
---|
860 | if( uiChromaPredMode == LM_CHROMA_IDX && uiChromaId == 0 ) |
---|
861 | { |
---|
862 | pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, uiTrDepth, |
---|
863 | m_pcPrediction->getPredicBuf (), |
---|
864 | m_pcPrediction->getPredicBufWidth (), |
---|
865 | m_pcPrediction->getPredicBufHeight (), |
---|
866 | bAboveAvail, bLeftAvail, |
---|
867 | true ); |
---|
868 | |
---|
869 | m_pcPrediction->getLumaRecPixels( pcCU->getPattern(), uiWidth, uiHeight ); |
---|
870 | } |
---|
871 | |
---|
872 | pcCU->getPattern()->initAdiPatternChroma( pcCU, uiAbsPartIdx, uiTrDepth, |
---|
873 | m_pcPrediction->getPredicBuf (), |
---|
874 | m_pcPrediction->getPredicBufWidth (), |
---|
875 | m_pcPrediction->getPredicBufHeight (), |
---|
876 | bAboveAvail, bLeftAvail ); |
---|
877 | Int* pPatChroma = ( uiChromaId > 0 ? pcCU->getPattern()->getAdiCrBuf( uiWidth, uiHeight, m_pcPrediction->getPredicBuf() ) : pcCU->getPattern()->getAdiCbBuf( uiWidth, uiHeight, m_pcPrediction->getPredicBuf() ) ); |
---|
878 | |
---|
879 | //===== get prediction signal ===== |
---|
880 | if( uiChromaPredMode == LM_CHROMA_IDX ) |
---|
881 | { |
---|
882 | m_pcPrediction->predLMIntraChroma( pcCU->getPattern(), pPatChroma, piPred, uiStride, uiWidth, uiHeight, uiChromaId ); |
---|
883 | } |
---|
884 | else |
---|
885 | { |
---|
886 | if( uiChromaPredMode == DM_CHROMA_IDX ) |
---|
887 | { |
---|
888 | uiChromaPredMode = pcCU->getLumaIntraDir( 0 ); |
---|
889 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
890 | mapDMMtoIntraMode( uiChromaPredMode ); |
---|
891 | #endif |
---|
892 | } |
---|
893 | m_pcPrediction->predIntraChromaAng( pcCU->getPattern(), pPatChroma, uiChromaPredMode, piPred, uiStride, uiWidth, uiHeight, pcCU, bAboveAvail, bLeftAvail ); |
---|
894 | } |
---|
895 | |
---|
896 | //===== inverse transform ===== |
---|
897 | if(eText == TEXT_CHROMA_U) |
---|
898 | { |
---|
899 | #if H0736_AVC_STYLE_QP_RANGE |
---|
900 | m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), eText, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaQpOffset() ); |
---|
901 | #else |
---|
902 | m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), eText, pcCU->getSlice()->getPPS()->getChromaQpOffset() ); |
---|
903 | #endif |
---|
904 | } |
---|
905 | else |
---|
906 | { |
---|
907 | #if H0736_AVC_STYLE_QP_RANGE |
---|
908 | m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), eText, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaQpOffset2nd() ); |
---|
909 | #else |
---|
910 | m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), eText, pcCU->getSlice()->getPPS()->getChromaQpOffset2nd() ); |
---|
911 | #endif |
---|
912 | } |
---|
913 | |
---|
914 | Int scalingListType = (pcCU->isIntra(uiAbsPartIdx) ? 0 : 3) + g_eTTable[(Int)eText]; |
---|
915 | assert(scalingListType < 6); |
---|
916 | #if LOSSLESS_CODING |
---|
917 | m_pcTrQuant->invtransformNxN( pcCU, eText, REG_DCT, piResi, uiStride, pcCoeff, uiWidth, uiHeight, scalingListType ); |
---|
918 | #else |
---|
919 | m_pcTrQuant->invtransformNxN( eText, REG_DCT, piResi, uiStride, pcCoeff, uiWidth, uiHeight, scalingListType ); |
---|
920 | #endif |
---|
921 | |
---|
922 | //===== reconstruction ===== |
---|
923 | Pel* pPred = piPred; |
---|
924 | Pel* pResi = piResi; |
---|
925 | Pel* pReco = piReco; |
---|
926 | Pel* pRecIPred = piRecIPred; |
---|
927 | for( UInt uiY = 0; uiY < uiHeight; uiY++ ) |
---|
928 | { |
---|
929 | for( UInt uiX = 0; uiX < uiWidth; uiX++ ) |
---|
930 | { |
---|
931 | pReco [ uiX ] = Clip( pPred[ uiX ] + pResi[ uiX ] ); |
---|
932 | pRecIPred[ uiX ] = pReco[ uiX ]; |
---|
933 | } |
---|
934 | pPred += uiStride; |
---|
935 | pResi += uiStride; |
---|
936 | pReco += uiStride; |
---|
937 | pRecIPred += uiRecIPredStride; |
---|
938 | } |
---|
939 | } |
---|
940 | |
---|
941 | Void |
---|
942 | TDecCu::xIntraRecQT( TComDataCU* pcCU, |
---|
943 | UInt uiTrDepth, |
---|
944 | UInt uiAbsPartIdx, |
---|
945 | TComYuv* pcRecoYuv, |
---|
946 | TComYuv* pcPredYuv, |
---|
947 | TComYuv* pcResiYuv ) |
---|
948 | { |
---|
949 | UInt uiFullDepth = pcCU->getDepth(0) + uiTrDepth; |
---|
950 | UInt uiTrMode = pcCU->getTransformIdx( uiAbsPartIdx ); |
---|
951 | if( uiTrMode == uiTrDepth ) |
---|
952 | { |
---|
953 | xIntraRecLumaBlk ( pcCU, uiTrDepth, uiAbsPartIdx, pcRecoYuv, pcPredYuv, pcResiYuv ); |
---|
954 | xIntraRecChromaBlk( pcCU, uiTrDepth, uiAbsPartIdx, pcRecoYuv, pcPredYuv, pcResiYuv, 0 ); |
---|
955 | xIntraRecChromaBlk( pcCU, uiTrDepth, uiAbsPartIdx, pcRecoYuv, pcPredYuv, pcResiYuv, 1 ); |
---|
956 | } |
---|
957 | else |
---|
958 | { |
---|
959 | UInt uiNumQPart = pcCU->getPic()->getNumPartInCU() >> ( ( uiFullDepth + 1 ) << 1 ); |
---|
960 | for( UInt uiPart = 0; uiPart < 4; uiPart++ ) |
---|
961 | { |
---|
962 | xIntraRecQT( pcCU, uiTrDepth + 1, uiAbsPartIdx + uiPart * uiNumQPart, pcRecoYuv, pcPredYuv, pcResiYuv ); |
---|
963 | } |
---|
964 | } |
---|
965 | } |
---|
966 | |
---|
967 | Void |
---|
968 | TDecCu::xReconIntraQT( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
969 | { |
---|
970 | UInt uiInitTrDepth = ( pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1 ); |
---|
971 | UInt uiNumPart = pcCU->getNumPartInter(); |
---|
972 | UInt uiNumQParts = pcCU->getTotalNumPart() >> 2; |
---|
973 | |
---|
974 | if (pcCU->getIPCMFlag(0)) |
---|
975 | { |
---|
976 | xReconPCM( pcCU, uiAbsPartIdx, uiDepth ); |
---|
977 | return; |
---|
978 | } |
---|
979 | |
---|
980 | for( UInt uiPU = 0; uiPU < uiNumPart; uiPU++ ) |
---|
981 | { |
---|
982 | xIntraLumaRecQT( pcCU, uiInitTrDepth, uiPU * uiNumQParts, m_ppcYuvReco[uiDepth], m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth] ); |
---|
983 | } |
---|
984 | |
---|
985 | for( UInt uiPU = 0; uiPU < uiNumPart; uiPU++ ) |
---|
986 | { |
---|
987 | xIntraChromaRecQT( pcCU, uiInitTrDepth, uiPU * uiNumQParts, m_ppcYuvReco[uiDepth], m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth] ); |
---|
988 | } |
---|
989 | |
---|
990 | } |
---|
991 | |
---|
992 | #if RWTH_SDC_DLT_B0036 |
---|
993 | Void TDecCu::xReconIntraSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
994 | { |
---|
995 | UInt uiWidth = pcCU->getWidth ( 0 ); |
---|
996 | UInt uiHeight = pcCU->getHeight ( 0 ); |
---|
997 | |
---|
998 | TComYuv* pcRecoYuv = m_ppcYuvReco[uiDepth]; |
---|
999 | TComYuv* pcPredYuv = m_ppcYuvReco[uiDepth]; |
---|
1000 | TComYuv* pcResiYuv = m_ppcYuvResi[uiDepth]; |
---|
1001 | |
---|
1002 | UInt uiStride = pcRecoYuv->getStride (); |
---|
1003 | Pel* piReco = pcRecoYuv->getLumaAddr( uiAbsPartIdx ); |
---|
1004 | Pel* piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); |
---|
1005 | Pel* piResi = pcResiYuv->getLumaAddr( uiAbsPartIdx ); |
---|
1006 | |
---|
1007 | UInt uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx; |
---|
1008 | Pel* piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); |
---|
1009 | UInt uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); |
---|
1010 | |
---|
1011 | UInt uiLumaPredMode = pcCU->getLumaIntraDir ( uiAbsPartIdx ); |
---|
1012 | |
---|
1013 | AOF( uiWidth == uiHeight ); |
---|
1014 | AOF( uiAbsPartIdx == 0 ); |
---|
1015 | AOF( pcCU->getSDCAvailable(uiAbsPartIdx) ); |
---|
1016 | AOF( pcCU->getSDCFlag(uiAbsPartIdx) ); |
---|
1017 | |
---|
1018 | //===== init availability pattern ===== |
---|
1019 | Bool bAboveAvail = false; |
---|
1020 | Bool bLeftAvail = false; |
---|
1021 | pcCU->getPattern()->initPattern ( pcCU, 0, uiAbsPartIdx ); |
---|
1022 | pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail ); |
---|
1023 | |
---|
1024 | //===== get prediction signal ===== |
---|
1025 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
1026 | if( uiLumaPredMode >= NUM_INTRA_MODE ) |
---|
1027 | { |
---|
1028 | m_pcPrediction->predIntraLumaDMM( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail, false ); |
---|
1029 | } |
---|
1030 | else |
---|
1031 | { |
---|
1032 | #endif |
---|
1033 | m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, pcCU, bAboveAvail, bLeftAvail ); |
---|
1034 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
1035 | } |
---|
1036 | #endif |
---|
1037 | |
---|
1038 | // number of segments depends on prediction mode |
---|
1039 | UInt uiNumSegments = 1; |
---|
1040 | Bool* pbMask = NULL; |
---|
1041 | UInt uiMaskStride = 0; |
---|
1042 | |
---|
1043 | if( uiLumaPredMode == DMM_WEDGE_FULL_IDX || uiLumaPredMode == DMM_WEDGE_PREDDIR_IDX ) |
---|
1044 | { |
---|
1045 | Int uiTabIdx = (uiLumaPredMode == DMM_WEDGE_FULL_IDX)?pcCU->getWedgeFullTabIdx(uiAbsPartIdx):pcCU->getWedgePredDirTabIdx(uiAbsPartIdx); |
---|
1046 | |
---|
1047 | WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])]; |
---|
1048 | TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx )); |
---|
1049 | |
---|
1050 | uiNumSegments = 2; |
---|
1051 | pbMask = pcWedgelet->getPattern(); |
---|
1052 | uiMaskStride = pcWedgelet->getStride(); |
---|
1053 | } |
---|
1054 | |
---|
1055 | // get DC prediction for each segment |
---|
1056 | Pel apDCPredValues[2]; |
---|
1057 | xAnalyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride); |
---|
1058 | |
---|
1059 | // reconstruct residual based on mask + DC residuals |
---|
1060 | Pel apDCResiValues[2]; |
---|
1061 | Pel apDCRecoValues[2]; |
---|
1062 | for( UInt ui = 0; ui < uiNumSegments; ui++ ) |
---|
1063 | { |
---|
1064 | Pel pPredIdx = GetDepthValue2Idx( apDCPredValues[ui] ); |
---|
1065 | Pel pResiIdx = pcCU->getSDCSegmentDCOffset(ui, uiAbsPartIdx); |
---|
1066 | Pel pRecoValue = GetIdx2DepthValue( pPredIdx + pResiIdx ); |
---|
1067 | |
---|
1068 | apDCRecoValues[ui] = pRecoValue; |
---|
1069 | apDCResiValues[ui] = pRecoValue - apDCPredValues[ui]; |
---|
1070 | } |
---|
1071 | |
---|
1072 | //===== reconstruction ===== |
---|
1073 | Bool*pMask = pbMask; |
---|
1074 | Pel* pPred = piPred; |
---|
1075 | Pel* pResi = piResi; |
---|
1076 | Pel* pReco = piReco; |
---|
1077 | Pel* pRecIPred = piRecIPred; |
---|
1078 | |
---|
1079 | for( UInt uiY = 0; uiY < uiHeight; uiY++ ) |
---|
1080 | { |
---|
1081 | for( UInt uiX = 0; uiX < uiWidth; uiX++ ) |
---|
1082 | { |
---|
1083 | UChar ucSegment = pMask?(UChar)pMask[uiX]:0; |
---|
1084 | assert( ucSegment < uiNumSegments ); |
---|
1085 | |
---|
1086 | Pel pPredVal= apDCPredValues[ucSegment]; |
---|
1087 | Pel pResiDC = apDCResiValues[ucSegment]; |
---|
1088 | |
---|
1089 | pReco [ uiX ] = Clip( pPredVal + pResiDC ); |
---|
1090 | pRecIPred[ uiX ] = pReco[ uiX ]; |
---|
1091 | } |
---|
1092 | pPred += uiStride; |
---|
1093 | pResi += uiStride; |
---|
1094 | pReco += uiStride; |
---|
1095 | pRecIPred += uiRecIPredStride; |
---|
1096 | pMask += uiMaskStride; |
---|
1097 | } |
---|
1098 | |
---|
1099 | // clear UV |
---|
1100 | UInt uiStrideC = pcPredYuv->getCStride(); |
---|
1101 | Pel *pRecCb = pcPredYuv->getCbAddr(); |
---|
1102 | Pel *pRecCr = pcPredYuv->getCrAddr(); |
---|
1103 | |
---|
1104 | for (Int y=0; y<uiHeight/2; y++) |
---|
1105 | { |
---|
1106 | for (Int x=0; x<uiWidth/2; x++) |
---|
1107 | { |
---|
1108 | pRecCb[x] = (Pel)(128<<g_uiBitIncrement); |
---|
1109 | pRecCr[x] = (Pel)(128<<g_uiBitIncrement); |
---|
1110 | } |
---|
1111 | |
---|
1112 | pRecCb += uiStrideC; |
---|
1113 | pRecCr += uiStrideC; |
---|
1114 | } |
---|
1115 | } |
---|
1116 | #endif |
---|
1117 | |
---|
1118 | /** Function for deriving recontructed PU/CU Luma sample with QTree structure |
---|
1119 | * \param pcCU pointer of current CU |
---|
1120 | * \param uiTrDepth current tranform split depth |
---|
1121 | * \param uiAbsPartIdx part index |
---|
1122 | * \param pcRecoYuv pointer to reconstructed sample arrays |
---|
1123 | * \param pcPredYuv pointer to prediction sample arrays |
---|
1124 | * \param pcResiYuv pointer to residue sample arrays |
---|
1125 | * |
---|
1126 | \ This function dervies recontructed PU/CU Luma sample with recursive QTree structure |
---|
1127 | */ |
---|
1128 | Void |
---|
1129 | TDecCu::xIntraLumaRecQT( TComDataCU* pcCU, |
---|
1130 | UInt uiTrDepth, |
---|
1131 | UInt uiAbsPartIdx, |
---|
1132 | TComYuv* pcRecoYuv, |
---|
1133 | TComYuv* pcPredYuv, |
---|
1134 | TComYuv* pcResiYuv ) |
---|
1135 | { |
---|
1136 | UInt uiFullDepth = pcCU->getDepth(0) + uiTrDepth; |
---|
1137 | UInt uiTrMode = pcCU->getTransformIdx( uiAbsPartIdx ); |
---|
1138 | if( uiTrMode == uiTrDepth ) |
---|
1139 | { |
---|
1140 | xIntraRecLumaBlk ( pcCU, uiTrDepth, uiAbsPartIdx, pcRecoYuv, pcPredYuv, pcResiYuv ); |
---|
1141 | } |
---|
1142 | else |
---|
1143 | { |
---|
1144 | UInt uiNumQPart = pcCU->getPic()->getNumPartInCU() >> ( ( uiFullDepth + 1 ) << 1 ); |
---|
1145 | for( UInt uiPart = 0; uiPart < 4; uiPart++ ) |
---|
1146 | { |
---|
1147 | xIntraLumaRecQT( pcCU, uiTrDepth + 1, uiAbsPartIdx + uiPart * uiNumQPart, pcRecoYuv, pcPredYuv, pcResiYuv ); |
---|
1148 | } |
---|
1149 | } |
---|
1150 | } |
---|
1151 | |
---|
1152 | /** Function for deriving recontructed PU/CU chroma samples with QTree structure |
---|
1153 | * \param pcCU pointer of current CU |
---|
1154 | * \param uiTrDepth current tranform split depth |
---|
1155 | * \param uiAbsPartIdx part index |
---|
1156 | * \param pcRecoYuv pointer to reconstructed sample arrays |
---|
1157 | * \param pcPredYuv pointer to prediction sample arrays |
---|
1158 | * \param pcResiYuv pointer to residue sample arrays |
---|
1159 | * |
---|
1160 | \ This function dervies recontructed PU/CU chroma samples with QTree recursive structure |
---|
1161 | */ |
---|
1162 | Void |
---|
1163 | TDecCu::xIntraChromaRecQT( TComDataCU* pcCU, |
---|
1164 | UInt uiTrDepth, |
---|
1165 | UInt uiAbsPartIdx, |
---|
1166 | TComYuv* pcRecoYuv, |
---|
1167 | TComYuv* pcPredYuv, |
---|
1168 | TComYuv* pcResiYuv ) |
---|
1169 | { |
---|
1170 | UInt uiFullDepth = pcCU->getDepth(0) + uiTrDepth; |
---|
1171 | UInt uiTrMode = pcCU->getTransformIdx( uiAbsPartIdx ); |
---|
1172 | if( uiTrMode == uiTrDepth ) |
---|
1173 | { |
---|
1174 | xIntraRecChromaBlk( pcCU, uiTrDepth, uiAbsPartIdx, pcRecoYuv, pcPredYuv, pcResiYuv, 0 ); |
---|
1175 | xIntraRecChromaBlk( pcCU, uiTrDepth, uiAbsPartIdx, pcRecoYuv, pcPredYuv, pcResiYuv, 1 ); |
---|
1176 | } |
---|
1177 | else |
---|
1178 | { |
---|
1179 | UInt uiNumQPart = pcCU->getPic()->getNumPartInCU() >> ( ( uiFullDepth + 1 ) << 1 ); |
---|
1180 | for( UInt uiPart = 0; uiPart < 4; uiPart++ ) |
---|
1181 | { |
---|
1182 | xIntraChromaRecQT( pcCU, uiTrDepth + 1, uiAbsPartIdx + uiPart * uiNumQPart, pcRecoYuv, pcPredYuv, pcResiYuv ); |
---|
1183 | } |
---|
1184 | } |
---|
1185 | } |
---|
1186 | |
---|
1187 | Void TDecCu::xCopyToPic( TComDataCU* pcCU, TComPic* pcPic, UInt uiZorderIdx, UInt uiDepth ) |
---|
1188 | { |
---|
1189 | UInt uiCUAddr = pcCU->getAddr(); |
---|
1190 | |
---|
1191 | m_ppcYuvReco[uiDepth]->copyToPicYuv ( pcPic->getPicYuvRec (), uiCUAddr, uiZorderIdx ); |
---|
1192 | |
---|
1193 | return; |
---|
1194 | } |
---|
1195 | |
---|
1196 | Void TDecCu::xDecodeInterTexture ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
1197 | { |
---|
1198 | UInt uiWidth = pcCU->getWidth ( uiAbsPartIdx ); |
---|
1199 | UInt uiHeight = pcCU->getHeight( uiAbsPartIdx ); |
---|
1200 | TCoeff* piCoeff; |
---|
1201 | |
---|
1202 | Pel* pResi; |
---|
1203 | UInt uiLumaTrMode, uiChromaTrMode; |
---|
1204 | |
---|
1205 | pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx( uiAbsPartIdx ), uiLumaTrMode, uiChromaTrMode ); |
---|
1206 | |
---|
1207 | // Y |
---|
1208 | piCoeff = pcCU->getCoeffY(); |
---|
1209 | pResi = m_ppcYuvResi[uiDepth]->getLumaAddr(); |
---|
1210 | |
---|
1211 | #if H0736_AVC_STYLE_QP_RANGE |
---|
1212 | m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 ); |
---|
1213 | #else |
---|
1214 | m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA, 0 ); |
---|
1215 | #endif |
---|
1216 | |
---|
1217 | m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_LUMA, pResi, 0, m_ppcYuvResi[uiDepth]->getStride(), uiWidth, uiHeight, uiLumaTrMode, 0, piCoeff ); |
---|
1218 | |
---|
1219 | // Cb and Cr |
---|
1220 | #if H0736_AVC_STYLE_QP_RANGE |
---|
1221 | m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaQpOffset() ); |
---|
1222 | #else |
---|
1223 | m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA, pcCU->getSlice()->getPPS()->getChromaQpOffset() ); |
---|
1224 | #endif |
---|
1225 | |
---|
1226 | uiWidth >>= 1; |
---|
1227 | uiHeight >>= 1; |
---|
1228 | piCoeff = pcCU->getCoeffCb(); pResi = m_ppcYuvResi[uiDepth]->getCbAddr(); |
---|
1229 | m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_CHROMA_U, pResi, 0, m_ppcYuvResi[uiDepth]->getCStride(), uiWidth, uiHeight, uiChromaTrMode, 0, piCoeff ); |
---|
1230 | |
---|
1231 | #if H0736_AVC_STYLE_QP_RANGE |
---|
1232 | m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaQpOffset2nd() ); |
---|
1233 | #else |
---|
1234 | m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA, pcCU->getSlice()->getPPS()->getChromaQpOffset2nd() ); |
---|
1235 | #endif |
---|
1236 | |
---|
1237 | piCoeff = pcCU->getCoeffCr(); pResi = m_ppcYuvResi[uiDepth]->getCrAddr(); |
---|
1238 | m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_CHROMA_V, pResi, 0, m_ppcYuvResi[uiDepth]->getCStride(), uiWidth, uiHeight, uiChromaTrMode, 0, piCoeff ); |
---|
1239 | } |
---|
1240 | |
---|
1241 | /** Function for deriving reconstructed luma/chroma samples of a PCM mode CU. |
---|
1242 | * \param pcCU pointer to current CU |
---|
1243 | * \param uiPartIdx part index |
---|
1244 | * \param piPCM pointer to PCM code arrays |
---|
1245 | * \param piReco pointer to reconstructed sample arrays |
---|
1246 | * \param uiStride stride of reconstructed sample arrays |
---|
1247 | * \param uiWidth CU width |
---|
1248 | * \param uiHeight CU height |
---|
1249 | * \param ttText texture component type |
---|
1250 | * \returns Void |
---|
1251 | */ |
---|
1252 | Void TDecCu::xDecodePCMTexture( TComDataCU* pcCU, UInt uiPartIdx, Pel *piPCM, Pel* piReco, UInt uiStride, UInt uiWidth, UInt uiHeight, TextType ttText) |
---|
1253 | { |
---|
1254 | UInt uiX, uiY; |
---|
1255 | Pel* piPicReco; |
---|
1256 | UInt uiPicStride; |
---|
1257 | UInt uiPcmLeftShiftBit; |
---|
1258 | |
---|
1259 | if( ttText == TEXT_LUMA ) |
---|
1260 | { |
---|
1261 | uiPicStride = pcCU->getPic()->getPicYuvRec()->getStride(); |
---|
1262 | piPicReco = pcCU->getPic()->getPicYuvRec()->getLumaAddr(pcCU->getAddr(), pcCU->getZorderIdxInCU()+uiPartIdx); |
---|
1263 | uiPcmLeftShiftBit = g_uiBitDepth + g_uiBitIncrement - pcCU->getSlice()->getSPS()->getPCMBitDepthLuma(); |
---|
1264 | } |
---|
1265 | else |
---|
1266 | { |
---|
1267 | uiPicStride = pcCU->getPic()->getPicYuvRec()->getCStride(); |
---|
1268 | |
---|
1269 | if( ttText == TEXT_CHROMA_U ) |
---|
1270 | { |
---|
1271 | piPicReco = pcCU->getPic()->getPicYuvRec()->getCbAddr(pcCU->getAddr(), pcCU->getZorderIdxInCU()+uiPartIdx); |
---|
1272 | } |
---|
1273 | else |
---|
1274 | { |
---|
1275 | piPicReco = pcCU->getPic()->getPicYuvRec()->getCrAddr(pcCU->getAddr(), pcCU->getZorderIdxInCU()+uiPartIdx); |
---|
1276 | } |
---|
1277 | uiPcmLeftShiftBit = g_uiBitDepth + g_uiBitIncrement - pcCU->getSlice()->getSPS()->getPCMBitDepthChroma(); |
---|
1278 | } |
---|
1279 | |
---|
1280 | for( uiY = 0; uiY < uiHeight; uiY++ ) |
---|
1281 | { |
---|
1282 | for( uiX = 0; uiX < uiWidth; uiX++ ) |
---|
1283 | { |
---|
1284 | piReco[uiX] = (piPCM[uiX] << uiPcmLeftShiftBit); |
---|
1285 | piPicReco[uiX] = piReco[uiX]; |
---|
1286 | } |
---|
1287 | piPCM += uiWidth; |
---|
1288 | piReco += uiStride; |
---|
1289 | piPicReco += uiPicStride; |
---|
1290 | } |
---|
1291 | } |
---|
1292 | |
---|
1293 | /** Function for reconstructing a PCM mode CU. |
---|
1294 | * \param pcCU pointer to current CU |
---|
1295 | * \param uiAbsPartIdx CU index |
---|
1296 | * \param uiDepth CU Depth |
---|
1297 | * \returns Void |
---|
1298 | */ |
---|
1299 | Void TDecCu::xReconPCM( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
1300 | { |
---|
1301 | // Luma |
---|
1302 | UInt uiWidth = (g_uiMaxCUWidth >> uiDepth); |
---|
1303 | UInt uiHeight = (g_uiMaxCUHeight >> uiDepth); |
---|
1304 | |
---|
1305 | Pel* piPcmY = pcCU->getPCMSampleY(); |
---|
1306 | Pel* piRecoY = m_ppcYuvReco[uiDepth]->getLumaAddr(0, uiWidth); |
---|
1307 | |
---|
1308 | UInt uiStride = m_ppcYuvResi[uiDepth]->getStride(); |
---|
1309 | |
---|
1310 | xDecodePCMTexture( pcCU, 0, piPcmY, piRecoY, uiStride, uiWidth, uiHeight, TEXT_LUMA); |
---|
1311 | |
---|
1312 | // Cb and Cr |
---|
1313 | UInt uiCWidth = (uiWidth>>1); |
---|
1314 | UInt uiCHeight = (uiHeight>>1); |
---|
1315 | |
---|
1316 | Pel* piPcmCb = pcCU->getPCMSampleCb(); |
---|
1317 | Pel* piPcmCr = pcCU->getPCMSampleCr(); |
---|
1318 | Pel* pRecoCb = m_ppcYuvReco[uiDepth]->getCbAddr(); |
---|
1319 | Pel* pRecoCr = m_ppcYuvReco[uiDepth]->getCrAddr(); |
---|
1320 | |
---|
1321 | UInt uiCStride = m_ppcYuvReco[uiDepth]->getCStride(); |
---|
1322 | |
---|
1323 | xDecodePCMTexture( pcCU, 0, piPcmCb, pRecoCb, uiCStride, uiCWidth, uiCHeight, TEXT_CHROMA_U); |
---|
1324 | xDecodePCMTexture( pcCU, 0, piPcmCr, pRecoCr, uiCStride, uiCWidth, uiCHeight, TEXT_CHROMA_V); |
---|
1325 | } |
---|
1326 | |
---|
1327 | #if LOSSLESS_CODING |
---|
1328 | /** Function for filling the PCM buffer of a CU using its reconstructed sample array |
---|
1329 | * \param pcCU pointer to current CU |
---|
1330 | * \param uiAbsPartIdx CU index |
---|
1331 | * \param uiDepth CU Depth |
---|
1332 | * \returns Void |
---|
1333 | */ |
---|
1334 | Void TDecCu::xFillPCMBuffer(TComDataCU* pCU, UInt absPartIdx, UInt depth) |
---|
1335 | { |
---|
1336 | // Luma |
---|
1337 | UInt width = (g_uiMaxCUWidth >> depth); |
---|
1338 | UInt height = (g_uiMaxCUHeight >> depth); |
---|
1339 | |
---|
1340 | Pel* pPcmY = pCU->getPCMSampleY(); |
---|
1341 | Pel* pRecoY = m_ppcYuvReco[depth]->getLumaAddr(0, width); |
---|
1342 | |
---|
1343 | UInt stride = m_ppcYuvReco[depth]->getStride(); |
---|
1344 | |
---|
1345 | for(Int y = 0; y < height; y++ ) |
---|
1346 | { |
---|
1347 | for(Int x = 0; x < width; x++ ) |
---|
1348 | { |
---|
1349 | pPcmY[x] = pRecoY[x]; |
---|
1350 | } |
---|
1351 | pPcmY += width; |
---|
1352 | pRecoY += stride; |
---|
1353 | } |
---|
1354 | |
---|
1355 | // Cb and Cr |
---|
1356 | UInt widthC = (width>>1); |
---|
1357 | UInt heightC = (height>>1); |
---|
1358 | |
---|
1359 | Pel* pPcmCb = pCU->getPCMSampleCb(); |
---|
1360 | Pel* pPcmCr = pCU->getPCMSampleCr(); |
---|
1361 | Pel* pRecoCb = m_ppcYuvReco[depth]->getCbAddr(); |
---|
1362 | Pel* pRecoCr = m_ppcYuvReco[depth]->getCrAddr(); |
---|
1363 | |
---|
1364 | UInt strideC = m_ppcYuvReco[depth]->getCStride(); |
---|
1365 | |
---|
1366 | for(Int y = 0; y < heightC; y++ ) |
---|
1367 | { |
---|
1368 | for(Int x = 0; x < widthC; x++ ) |
---|
1369 | { |
---|
1370 | pPcmCb[x] = pRecoCb[x]; |
---|
1371 | pPcmCr[x] = pRecoCr[x]; |
---|
1372 | } |
---|
1373 | pPcmCr += widthC; |
---|
1374 | pPcmCb += widthC; |
---|
1375 | pRecoCb += strideC; |
---|
1376 | pRecoCr += strideC; |
---|
1377 | } |
---|
1378 | |
---|
1379 | } |
---|
1380 | #endif |
---|
1381 | |
---|
1382 | #if RWTH_SDC_DLT_B0036 |
---|
1383 | Void TDecCu::xAnalyzeSegmentsSDC( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride ) |
---|
1384 | { |
---|
1385 | Int iSumDepth[2]; |
---|
1386 | memset(iSumDepth, 0, sizeof(Int)*2); |
---|
1387 | Int iSumPix[2]; |
---|
1388 | memset(iSumPix, 0, sizeof(Int)*2); |
---|
1389 | #if HS_REFERENCE_SUBSAMPLE_C0154 |
---|
1390 | Int subSamplePix; |
---|
1391 | if ( uiSize == 64 || uiSize == 32 ) |
---|
1392 | { |
---|
1393 | subSamplePix = 2; |
---|
1394 | } |
---|
1395 | else |
---|
1396 | { |
---|
1397 | subSamplePix = 1; |
---|
1398 | } |
---|
1399 | for (Int y=0; y<uiSize; y+=subSamplePix) |
---|
1400 | { |
---|
1401 | for (Int x=0; x<uiSize; x+=subSamplePix) |
---|
1402 | { |
---|
1403 | UChar ucSegment = pMask?(UChar)pMask[x]:0; |
---|
1404 | assert( ucSegment < uiNumSegments ); |
---|
1405 | |
---|
1406 | iSumDepth[ucSegment] += pOrig[x]; |
---|
1407 | iSumPix[ucSegment] += 1; |
---|
1408 | } |
---|
1409 | pOrig += uiStride*subSamplePix; |
---|
1410 | pMask += uiMaskStride*subSamplePix; |
---|
1411 | } |
---|
1412 | #else |
---|
1413 | for (Int y=0; y<uiSize; y++) |
---|
1414 | { |
---|
1415 | for (Int x=0; x<uiSize; x++) |
---|
1416 | { |
---|
1417 | UChar ucSegment = pMask?(UChar)pMask[x]:0; |
---|
1418 | assert( ucSegment < uiNumSegments ); |
---|
1419 | |
---|
1420 | iSumDepth[ucSegment] += pOrig[x]; |
---|
1421 | iSumPix[ucSegment] += 1; |
---|
1422 | } |
---|
1423 | |
---|
1424 | pOrig += uiStride; |
---|
1425 | pMask += uiMaskStride; |
---|
1426 | } |
---|
1427 | #endif |
---|
1428 | // compute mean for each segment |
---|
1429 | for( UChar ucSeg = 0; ucSeg < uiNumSegments; ucSeg++ ) |
---|
1430 | { |
---|
1431 | if( iSumPix[ucSeg] > 0 ) |
---|
1432 | rpSegMeans[ucSeg] = iSumDepth[ucSeg] / iSumPix[ucSeg]; |
---|
1433 | else |
---|
1434 | rpSegMeans[ucSeg] = 0; // this happens for zero-segments |
---|
1435 | } |
---|
1436 | } |
---|
1437 | #endif |
---|
1438 | |
---|
1439 | //! \} |
---|