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-2015, 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 | #include "TLibCommon/TComTU.h" |
---|
40 | #include "TLibCommon/TComPrediction.h" |
---|
41 | |
---|
42 | //! \ingroup TLibDecoder |
---|
43 | //! \{ |
---|
44 | |
---|
45 | // ==================================================================================================================== |
---|
46 | // Constructor / destructor / create / destroy |
---|
47 | // ==================================================================================================================== |
---|
48 | |
---|
49 | TDecCu::TDecCu() |
---|
50 | { |
---|
51 | m_ppcYuvResi = NULL; |
---|
52 | m_ppcYuvReco = NULL; |
---|
53 | m_ppcCU = NULL; |
---|
54 | #if H_3D_DBBP |
---|
55 | m_ppcYuvRecoDBBP = NULL; |
---|
56 | #endif |
---|
57 | } |
---|
58 | |
---|
59 | TDecCu::~TDecCu() |
---|
60 | { |
---|
61 | } |
---|
62 | |
---|
63 | Void TDecCu::init( TDecEntropy* pcEntropyDecoder, TComTrQuant* pcTrQuant, TComPrediction* pcPrediction) |
---|
64 | { |
---|
65 | m_pcEntropyDecoder = pcEntropyDecoder; |
---|
66 | m_pcTrQuant = pcTrQuant; |
---|
67 | m_pcPrediction = pcPrediction; |
---|
68 | } |
---|
69 | |
---|
70 | /** |
---|
71 | \param uiMaxDepth total number of allowable depth |
---|
72 | \param uiMaxWidth largest CU width |
---|
73 | \param uiMaxHeight largest CU height |
---|
74 | \param chromaFormatIDC chroma format |
---|
75 | */ |
---|
76 | Void TDecCu::create( UInt uiMaxDepth, UInt uiMaxWidth, UInt uiMaxHeight, ChromaFormat chromaFormatIDC ) |
---|
77 | { |
---|
78 | m_uiMaxDepth = uiMaxDepth+1; |
---|
79 | |
---|
80 | m_ppcYuvResi = new TComYuv*[m_uiMaxDepth-1]; |
---|
81 | m_ppcYuvReco = new TComYuv*[m_uiMaxDepth-1]; |
---|
82 | m_ppcCU = new TComDataCU*[m_uiMaxDepth-1]; |
---|
83 | #if H_3D_DBBP |
---|
84 | m_ppcYuvRecoDBBP = new TComYuv*[m_uiMaxDepth-1]; |
---|
85 | #endif |
---|
86 | |
---|
87 | UInt uiNumPartitions; |
---|
88 | for ( UInt ui = 0; ui < m_uiMaxDepth-1; ui++ ) |
---|
89 | { |
---|
90 | uiNumPartitions = 1<<( ( m_uiMaxDepth - ui - 1 )<<1 ); |
---|
91 | UInt uiWidth = uiMaxWidth >> ui; |
---|
92 | UInt uiHeight = uiMaxHeight >> ui; |
---|
93 | |
---|
94 | m_ppcYuvResi[ui] = new TComYuv; m_ppcYuvResi[ui]->create( uiWidth, uiHeight, chromaFormatIDC ); |
---|
95 | m_ppcYuvReco[ui] = new TComYuv; m_ppcYuvReco[ui]->create( uiWidth, uiHeight, chromaFormatIDC ); |
---|
96 | m_ppcCU [ui] = new TComDataCU; m_ppcCU [ui]->create( chromaFormatIDC, uiNumPartitions, uiWidth, uiHeight, true, uiMaxWidth >> (m_uiMaxDepth - 1) ); |
---|
97 | #if H_3D_DBBP |
---|
98 | m_ppcYuvRecoDBBP[ui] = new TComYuv; m_ppcYuvRecoDBBP[ui]->create( uiWidth, uiHeight ); |
---|
99 | #endif |
---|
100 | } |
---|
101 | |
---|
102 | m_bDecodeDQP = false; |
---|
103 | m_IsChromaQpAdjCoded = false; |
---|
104 | |
---|
105 | // initialize partition order. |
---|
106 | UInt* piTmp = &g_auiZscanToRaster[0]; |
---|
107 | initZscanToRaster(m_uiMaxDepth, 1, 0, piTmp); |
---|
108 | initRasterToZscan( uiMaxWidth, uiMaxHeight, m_uiMaxDepth ); |
---|
109 | |
---|
110 | // initialize conversion matrix from partition index to pel |
---|
111 | initRasterToPelXY( uiMaxWidth, uiMaxHeight, m_uiMaxDepth ); |
---|
112 | } |
---|
113 | |
---|
114 | Void TDecCu::destroy() |
---|
115 | { |
---|
116 | for ( UInt ui = 0; ui < m_uiMaxDepth-1; ui++ ) |
---|
117 | { |
---|
118 | m_ppcYuvResi[ui]->destroy(); delete m_ppcYuvResi[ui]; m_ppcYuvResi[ui] = NULL; |
---|
119 | m_ppcYuvReco[ui]->destroy(); delete m_ppcYuvReco[ui]; m_ppcYuvReco[ui] = NULL; |
---|
120 | m_ppcCU [ui]->destroy(); delete m_ppcCU [ui]; m_ppcCU [ui] = NULL; |
---|
121 | #if H_3D_DBBP |
---|
122 | m_ppcYuvRecoDBBP[ui]->destroy(); delete m_ppcYuvRecoDBBP[ui]; m_ppcYuvRecoDBBP[ui] = NULL; |
---|
123 | #endif |
---|
124 | } |
---|
125 | |
---|
126 | delete [] m_ppcYuvResi; m_ppcYuvResi = NULL; |
---|
127 | delete [] m_ppcYuvReco; m_ppcYuvReco = NULL; |
---|
128 | delete [] m_ppcCU ; m_ppcCU = NULL; |
---|
129 | #if H_3D_DBBP |
---|
130 | delete [] m_ppcYuvRecoDBBP; m_ppcYuvRecoDBBP = NULL; |
---|
131 | #endif |
---|
132 | } |
---|
133 | |
---|
134 | // ==================================================================================================================== |
---|
135 | // Public member functions |
---|
136 | // ==================================================================================================================== |
---|
137 | |
---|
138 | /** |
---|
139 | Parse a CTU. |
---|
140 | \param pCtu [in/out] pointer to CTU data structure |
---|
141 | \param isLastCtuOfSliceSegment [out] true, if last CTU of the slice segment |
---|
142 | */ |
---|
143 | Void TDecCu::decodeCtu( TComDataCU* pCtu, Bool& isLastCtuOfSliceSegment ) |
---|
144 | { |
---|
145 | if ( pCtu->getSlice()->getPPS()->getUseDQP() ) |
---|
146 | { |
---|
147 | setdQPFlag(true); |
---|
148 | } |
---|
149 | |
---|
150 | if ( pCtu->getSlice()->getUseChromaQpAdj() ) |
---|
151 | { |
---|
152 | setIsChromaQpAdjCoded(true); |
---|
153 | } |
---|
154 | |
---|
155 | // start from the top level CU |
---|
156 | xDecodeCU( pCtu, 0, 0, isLastCtuOfSliceSegment); |
---|
157 | } |
---|
158 | |
---|
159 | /** |
---|
160 | Decoding process for a CTU. |
---|
161 | \param pCtu [in/out] pointer to CTU data structure |
---|
162 | */ |
---|
163 | Void TDecCu::decompressCtu( TComDataCU* pCtu ) |
---|
164 | { |
---|
165 | #if !H_3D_IV_MERGE |
---|
166 | xDecompressCU( pCtu, 0, 0 ); |
---|
167 | #endif |
---|
168 | } |
---|
169 | |
---|
170 | // ==================================================================================================================== |
---|
171 | // Protected member functions |
---|
172 | // ==================================================================================================================== |
---|
173 | |
---|
174 | //! decode end-of-slice flag |
---|
175 | Bool TDecCu::xDecodeSliceEnd( TComDataCU* pcCU, UInt uiAbsPartIdx ) |
---|
176 | { |
---|
177 | UInt uiIsLastCtuOfSliceSegment; |
---|
178 | |
---|
179 | if (pcCU->isLastSubCUOfCtu(uiAbsPartIdx)) |
---|
180 | { |
---|
181 | m_pcEntropyDecoder->decodeTerminatingBit( uiIsLastCtuOfSliceSegment ); |
---|
182 | } |
---|
183 | else |
---|
184 | { |
---|
185 | uiIsLastCtuOfSliceSegment=0; |
---|
186 | } |
---|
187 | |
---|
188 | return uiIsLastCtuOfSliceSegment>0; |
---|
189 | } |
---|
190 | |
---|
191 | //! decode CU block recursively |
---|
192 | Void TDecCu::xDecodeCU( TComDataCU*const pcCU, const UInt uiAbsPartIdx, const UInt uiDepth, Bool &isLastCtuOfSliceSegment) |
---|
193 | { |
---|
194 | TComPic* pcPic = pcCU->getPic(); |
---|
195 | const TComSPS &sps = pcPic->getPicSym()->getSPS(); |
---|
196 | const TComPPS &pps = pcPic->getPicSym()->getPPS(); |
---|
197 | const UInt maxCuWidth = sps.getMaxCUWidth(); |
---|
198 | const UInt maxCuHeight= sps.getMaxCUHeight(); |
---|
199 | UInt uiCurNumParts = pcPic->getNumPartitionsInCtu() >> (uiDepth<<1); |
---|
200 | UInt uiQNumParts = uiCurNumParts>>2; |
---|
201 | |
---|
202 | |
---|
203 | Bool bBoundary = false; |
---|
204 | UInt uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; |
---|
205 | UInt uiRPelX = uiLPelX + (maxCuWidth>>uiDepth) - 1; |
---|
206 | UInt uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; |
---|
207 | UInt uiBPelY = uiTPelY + (maxCuHeight>>uiDepth) - 1; |
---|
208 | #if H_MV_ENC_DEC_TRAC |
---|
209 | DTRACE_CU_S("=========== coding_quadtree ===========\n") |
---|
210 | DTRACE_CU("x0", uiLPelX) |
---|
211 | DTRACE_CU("x1", uiTPelY) |
---|
212 | DTRACE_CU("log2CbSize", maxCuWidth>>uiDepth) |
---|
213 | DTRACE_CU("cqtDepth" , uiDepth) |
---|
214 | #endif |
---|
215 | |
---|
216 | if( ( uiRPelX < sps.getPicWidthInLumaSamples() ) && ( uiBPelY < sps.getPicHeightInLumaSamples() ) ) |
---|
217 | { |
---|
218 | m_pcEntropyDecoder->decodeSplitFlag( pcCU, uiAbsPartIdx, uiDepth ); |
---|
219 | } |
---|
220 | else |
---|
221 | { |
---|
222 | bBoundary = true; |
---|
223 | } |
---|
224 | if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() ) ) || bBoundary ) |
---|
225 | { |
---|
226 | UInt uiIdx = uiAbsPartIdx; |
---|
227 | if( uiDepth == pps.getMaxCuDQPDepth() && pps.getUseDQP()) |
---|
228 | { |
---|
229 | setdQPFlag(true); |
---|
230 | pcCU->setQPSubParts( pcCU->getRefQP(uiAbsPartIdx), uiAbsPartIdx, uiDepth ); // set QP to default QP |
---|
231 | } |
---|
232 | |
---|
233 | if( uiDepth == pps.getPpsRangeExtension().getDiffCuChromaQpOffsetDepth() && pcCU->getSlice()->getUseChromaQpAdj() ) |
---|
234 | { |
---|
235 | setIsChromaQpAdjCoded(true); |
---|
236 | } |
---|
237 | |
---|
238 | for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++ ) |
---|
239 | { |
---|
240 | uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiIdx] ]; |
---|
241 | uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiIdx] ]; |
---|
242 | |
---|
243 | if ( !isLastCtuOfSliceSegment && ( uiLPelX < sps.getPicWidthInLumaSamples() ) && ( uiTPelY < sps.getPicHeightInLumaSamples() ) ) |
---|
244 | { |
---|
245 | xDecodeCU( pcCU, uiIdx, uiDepth+1, isLastCtuOfSliceSegment ); |
---|
246 | } |
---|
247 | else |
---|
248 | { |
---|
249 | pcCU->setOutsideCUPart( uiIdx, uiDepth+1 ); |
---|
250 | } |
---|
251 | |
---|
252 | uiIdx += uiQNumParts; |
---|
253 | } |
---|
254 | if( uiDepth == pps.getMaxCuDQPDepth() && pps.getUseDQP()) |
---|
255 | { |
---|
256 | if ( getdQPFlag() ) |
---|
257 | { |
---|
258 | UInt uiQPSrcPartIdx = uiAbsPartIdx; |
---|
259 | pcCU->setQPSubParts( pcCU->getRefQP( uiQPSrcPartIdx ), uiAbsPartIdx, uiDepth ); // set QP to default QP |
---|
260 | } |
---|
261 | } |
---|
262 | return; |
---|
263 | } |
---|
264 | |
---|
265 | #if H_MV_ENC_DEC_TRAC |
---|
266 | DTRACE_CU_S("=========== coding_unit ===========\n") |
---|
267 | #if H_MV_ENC_DEC_TRAC |
---|
268 | #if ENC_DEC_TRACE |
---|
269 | stopAtPos ( pcCU->getSlice()->getPOC(), |
---|
270 | pcCU->getSlice()->getLayerId(), |
---|
271 | uiLPelX, |
---|
272 | uiTPelY, |
---|
273 | uiRPelX-uiLPelX+1, |
---|
274 | uiBPelY-uiTPelY+1); |
---|
275 | #endif |
---|
276 | #endif |
---|
277 | |
---|
278 | #endif |
---|
279 | |
---|
280 | if( uiDepth <= pps.getMaxCuDQPDepth() && pps.getUseDQP()) |
---|
281 | { |
---|
282 | setdQPFlag(true); |
---|
283 | pcCU->setQPSubParts( pcCU->getRefQP(uiAbsPartIdx), uiAbsPartIdx, uiDepth ); // set QP to default QP |
---|
284 | } |
---|
285 | #if H_3D_NBDV |
---|
286 | DisInfo DvInfo; |
---|
287 | DvInfo.m_acNBDV.setZero(); |
---|
288 | DvInfo.m_aVIdxCan = 0; |
---|
289 | #if H_3D_NBDV_REF |
---|
290 | DvInfo.m_acDoNBDV.setZero(); |
---|
291 | #endif |
---|
292 | |
---|
293 | if(!pcCU->getSlice()->isIntra()) |
---|
294 | { |
---|
295 | #if H_3D_ARP && H_3D_IV_MERGE |
---|
296 | if( pcCU->getSlice()->getIvResPredFlag() || pcCU->getSlice()->getIvMvPredFlag() ) |
---|
297 | #else |
---|
298 | #if H_3D_ARP |
---|
299 | if( pcCU->getSlice()->getVPS()->getUseAdvRP(pcCU->getSlice()->getLayerId()) ) |
---|
300 | #else |
---|
301 | #if H_3D_IV_MERGE |
---|
302 | if( pcCU->getSlice()->getVPS()->getIvMvPredFlag(pcCU->getSlice()->getLayerId()) ) |
---|
303 | #else |
---|
304 | if (0) |
---|
305 | #endif |
---|
306 | #endif |
---|
307 | #endif |
---|
308 | { |
---|
309 | m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0, true ); |
---|
310 | m_ppcCU[uiDepth]->copyDVInfoFrom( pcCU, uiAbsPartIdx); |
---|
311 | PartSize ePartTemp = m_ppcCU[uiDepth]->getPartitionSize(0); |
---|
312 | UChar cWidTemp = m_ppcCU[uiDepth]->getWidth(0); |
---|
313 | UChar cHeightTemp = m_ppcCU[uiDepth]->getHeight(0); |
---|
314 | m_ppcCU[uiDepth]->setWidth ( 0, pcCU->getSlice()->getSPS()->getMaxCUWidth ()/(1<<uiDepth) ); |
---|
315 | m_ppcCU[uiDepth]->setHeight ( 0, pcCU->getSlice()->getSPS()->getMaxCUHeight()/(1<<uiDepth) ); |
---|
316 | m_ppcCU[uiDepth]->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); |
---|
317 | #if H_3D_IV_MERGE |
---|
318 | if( pcCU->getSlice()->getIsDepth()) |
---|
319 | { |
---|
320 | m_ppcCU[uiDepth]->getDispforDepth(0, 0, &DvInfo); |
---|
321 | } |
---|
322 | else |
---|
323 | { |
---|
324 | #endif |
---|
325 | #if H_3D_NBDV_REF |
---|
326 | if( pcCU->getSlice()->getDepthBasedBlkPartFlag() ) //Notes from QC: please check the condition for DoNBDV. Remove this comment once it is done. |
---|
327 | { |
---|
328 | m_ppcCU[uiDepth]->getDisMvpCandNBDV(&DvInfo, true); |
---|
329 | } |
---|
330 | else |
---|
331 | #endif |
---|
332 | { |
---|
333 | m_ppcCU[uiDepth]->getDisMvpCandNBDV(&DvInfo); |
---|
334 | } |
---|
335 | #if H_3D_IV_MERGE |
---|
336 | } |
---|
337 | #endif |
---|
338 | #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC |
---|
339 | if ( g_decTraceDispDer ) |
---|
340 | { |
---|
341 | DTRACE_CU( "RefViewIdx", DvInfo.m_aVIdxCan ); |
---|
342 | DTRACE_CU( "MvDisp[x]", DvInfo.m_acNBDV.getHor() ); |
---|
343 | DTRACE_CU( "MvDisp[y]", DvInfo.m_acNBDV.getVer() ); |
---|
344 | DTRACE_CU( "MvRefinedDisp[x]", DvInfo.m_acDoNBDV.getHor() ); |
---|
345 | DTRACE_CU( "MvRefinedDisp[y]", DvInfo.m_acDoNBDV.getVer() ); |
---|
346 | } |
---|
347 | #endif |
---|
348 | |
---|
349 | pcCU->setDvInfoSubParts(DvInfo, uiAbsPartIdx, uiDepth); |
---|
350 | m_ppcCU[uiDepth]->setPartSizeSubParts( ePartTemp, 0, uiDepth ); |
---|
351 | m_ppcCU[uiDepth]->setWidth ( 0, cWidTemp ); |
---|
352 | m_ppcCU[uiDepth]->setHeight ( 0, cHeightTemp ); |
---|
353 | } |
---|
354 | } |
---|
355 | #endif |
---|
356 | |
---|
357 | if( uiDepth <= pps.getPpsRangeExtension().getDiffCuChromaQpOffsetDepth() && pcCU->getSlice()->getUseChromaQpAdj() ) |
---|
358 | { |
---|
359 | setIsChromaQpAdjCoded(true); |
---|
360 | } |
---|
361 | |
---|
362 | if (pps.getTransquantBypassEnableFlag()) |
---|
363 | { |
---|
364 | m_pcEntropyDecoder->decodeCUTransquantBypassFlag( pcCU, uiAbsPartIdx, uiDepth ); |
---|
365 | } |
---|
366 | |
---|
367 | // decode CU mode and the partition size |
---|
368 | if( !pcCU->getSlice()->isIntra()) |
---|
369 | { |
---|
370 | m_pcEntropyDecoder->decodeSkipFlag( pcCU, uiAbsPartIdx, uiDepth ); |
---|
371 | } |
---|
372 | |
---|
373 | |
---|
374 | if( pcCU->isSkipped(uiAbsPartIdx) ) |
---|
375 | { |
---|
376 | #if H_MV_ENC_DEC_TRAC |
---|
377 | DTRACE_PU_S("=========== prediction_unit ===========\n") |
---|
378 | DTRACE_PU("x0", uiLPelX) |
---|
379 | DTRACE_PU("x1", uiTPelY) |
---|
380 | #endif |
---|
381 | m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 ); |
---|
382 | m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 ); |
---|
383 | #if H_3D_IV_MERGE |
---|
384 | m_ppcCU[uiDepth]->copyDVInfoFrom(pcCU, uiAbsPartIdx); |
---|
385 | TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists |
---|
386 | UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; |
---|
387 | #else |
---|
388 | TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists |
---|
389 | UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS]; |
---|
390 | #endif |
---|
391 | Int numValidMergeCand = 0; |
---|
392 | for( UInt ui = 0; ui < m_ppcCU[uiDepth]->getSlice()->getMaxNumMergeCand(); ++ui ) |
---|
393 | { |
---|
394 | uhInterDirNeighbours[ui] = 0; |
---|
395 | } |
---|
396 | m_pcEntropyDecoder->decodeMergeIndex( pcCU, 0, uiAbsPartIdx, uiDepth ); |
---|
397 | UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx); |
---|
398 | #if H_3D_ARP |
---|
399 | m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth ); |
---|
400 | #endif |
---|
401 | #if NH_3D_IC |
---|
402 | m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); |
---|
403 | #endif |
---|
404 | |
---|
405 | #if H_3D_VSP |
---|
406 | Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; |
---|
407 | memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); |
---|
408 | #if H_3D_SPIVMP |
---|
409 | Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM]; |
---|
410 | memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); |
---|
411 | TComMvField* pcMvFieldSP; |
---|
412 | UChar* puhInterDirSP; |
---|
413 | pcMvFieldSP = new TComMvField[pcCU->getPic()->getPicSym()->getNumPartition()*2]; |
---|
414 | puhInterDirSP = new UChar[pcCU->getPic()->getPicSym()->getNumPartition()]; |
---|
415 | #endif |
---|
416 | m_ppcCU[uiDepth]->initAvailableFlags(); |
---|
417 | m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); |
---|
418 | m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours |
---|
419 | #if H_3D_SPIVMP |
---|
420 | , pcMvFieldSP, puhInterDirSP |
---|
421 | #endif |
---|
422 | , numValidMergeCand, uiMergeIndex ); |
---|
423 | |
---|
424 | m_ppcCU[uiDepth]->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag |
---|
425 | #if H_3D_SPIVMP |
---|
426 | , bSPIVMPFlag |
---|
427 | #endif |
---|
428 | , numValidMergeCand ); |
---|
429 | pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); |
---|
430 | #else |
---|
431 | #if H_3D |
---|
432 | m_ppcCU[uiDepth]->initAvailableFlags(); |
---|
433 | m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); |
---|
434 | m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); |
---|
435 | #else |
---|
436 | m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); |
---|
437 | #endif |
---|
438 | #endif |
---|
439 | pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); |
---|
440 | |
---|
441 | TComMv cTmpMv( 0, 0 ); |
---|
442 | for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) |
---|
443 | { |
---|
444 | if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 ) |
---|
445 | { |
---|
446 | pcCU->setMVPIdxSubParts( 0, RefPicList( uiRefListIdx ), uiAbsPartIdx, 0, uiDepth); |
---|
447 | pcCU->setMVPNumSubParts( 0, RefPicList( uiRefListIdx ), uiAbsPartIdx, 0, uiDepth); |
---|
448 | pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); |
---|
449 | pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); |
---|
450 | #if H_3D_VSP |
---|
451 | if( pcCU->getVSPFlag( uiAbsPartIdx ) != 0 ) |
---|
452 | { |
---|
453 | if ( uhInterDirNeighbours[ uiMergeIndex ] & (1<<uiRefListIdx) ) |
---|
454 | { |
---|
455 | UInt dummy; |
---|
456 | Int vspSize; |
---|
457 | Int width, height; |
---|
458 | m_ppcCU[uiDepth]->getPartIndexAndSize( uiAbsPartIdx, dummy, width, height ); |
---|
459 | m_ppcCU[uiDepth]->setMvFieldPUForVSP( pcCU, uiAbsPartIdx, width, height, RefPicList( uiRefListIdx ), cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getRefIdx(), vspSize ); |
---|
460 | pcCU->setVSPFlag( uiAbsPartIdx, vspSize ); |
---|
461 | } |
---|
462 | } |
---|
463 | #endif |
---|
464 | #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC |
---|
465 | if ( g_decTraceMvFromMerge ) |
---|
466 | { |
---|
467 | if ( uiRefListIdx == 0 ) |
---|
468 | { |
---|
469 | DTRACE_PU( "mvL0[0]", cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getHor()); |
---|
470 | DTRACE_PU( "mvL0[1]", cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getVer()); |
---|
471 | DTRACE_PU( "refIdxL0 ", cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getRefIdx()); |
---|
472 | } |
---|
473 | else |
---|
474 | { |
---|
475 | DTRACE_PU( "mvL1[0]", cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getHor()); |
---|
476 | DTRACE_PU( "mvL1[1]", cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getVer()); |
---|
477 | DTRACE_PU( "refIdxL1", cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getRefIdx()); |
---|
478 | } |
---|
479 | } |
---|
480 | #endif |
---|
481 | } |
---|
482 | } |
---|
483 | #if H_3D_SPIVMP |
---|
484 | pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); |
---|
485 | if (bSPIVMPFlag[uiMergeIndex]) |
---|
486 | { |
---|
487 | UInt uiSPAddr; |
---|
488 | Int iWidth = pcCU->getWidth(uiAbsPartIdx); |
---|
489 | Int iHeight = pcCU->getHeight(uiAbsPartIdx); |
---|
490 | |
---|
491 | Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight; |
---|
492 | |
---|
493 | pcCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight); |
---|
494 | |
---|
495 | for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++) |
---|
496 | { |
---|
497 | pcCU->getSPAbsPartIdx(uiAbsPartIdx, iSPWidth, iSPHeight, iPartitionIdx, iNumSPInOneLine, uiSPAddr); |
---|
498 | pcCU->setInterDirSP(puhInterDirSP[iPartitionIdx], uiSPAddr, iSPWidth, iSPHeight); |
---|
499 | pcCU->getCUMvField( REF_PIC_LIST_0 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx], iSPWidth, iSPHeight); |
---|
500 | pcCU->getCUMvField( REF_PIC_LIST_1 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx + 1], iSPWidth, iSPHeight); |
---|
501 | } |
---|
502 | } |
---|
503 | delete[] pcMvFieldSP; |
---|
504 | delete[] puhInterDirSP; |
---|
505 | #endif |
---|
506 | |
---|
507 | xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment ); |
---|
508 | #if H_3D_IV_MERGE |
---|
509 | xDecompressCU(pcCU, uiAbsPartIdx, uiDepth ); |
---|
510 | #endif |
---|
511 | |
---|
512 | return; |
---|
513 | } |
---|
514 | #if H_3D |
---|
515 | m_pcEntropyDecoder->decodeDIS( pcCU, uiAbsPartIdx, uiDepth ); |
---|
516 | if(!pcCU->getDISFlag(uiAbsPartIdx)) |
---|
517 | { |
---|
518 | #endif |
---|
519 | |
---|
520 | m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth ); |
---|
521 | m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth ); |
---|
522 | |
---|
523 | if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) |
---|
524 | { |
---|
525 | m_pcEntropyDecoder->decodeIPCMInfo( pcCU, uiAbsPartIdx, uiDepth ); |
---|
526 | |
---|
527 | if(pcCU->getIPCMFlag(uiAbsPartIdx)) |
---|
528 | { |
---|
529 | #if H_3D_DIM_SDC |
---|
530 | m_pcEntropyDecoder->decodeSDCFlag( pcCU, uiAbsPartIdx, uiDepth ); |
---|
531 | #endif |
---|
532 | xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment ); |
---|
533 | #if H_3D_IV_MERGE |
---|
534 | xDecompressCU(pcCU, uiAbsPartIdx, uiDepth ); |
---|
535 | #endif |
---|
536 | return; |
---|
537 | } |
---|
538 | } |
---|
539 | |
---|
540 | // prediction mode ( Intra : direction mode, Inter : Mv, reference idx ) |
---|
541 | m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]); |
---|
542 | |
---|
543 | // Coefficient decoding |
---|
544 | Bool bCodeDQP = getdQPFlag(); |
---|
545 | Bool isChromaQpAdjCoded = getIsChromaQpAdjCoded(); |
---|
546 | m_pcEntropyDecoder->decodeCoeff( pcCU, uiAbsPartIdx, uiDepth, bCodeDQP, isChromaQpAdjCoded ); |
---|
547 | setIsChromaQpAdjCoded( isChromaQpAdjCoded ); |
---|
548 | setdQPFlag( bCodeDQP ); |
---|
549 | #if H_3D |
---|
550 | } |
---|
551 | #endif |
---|
552 | xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment ); |
---|
553 | #if H_3D_IV_MERGE |
---|
554 | xDecompressCU(pcCU, uiAbsPartIdx, uiDepth ); |
---|
555 | #endif |
---|
556 | } |
---|
557 | |
---|
558 | Void TDecCu::xFinishDecodeCU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool &isLastCtuOfSliceSegment) |
---|
559 | { |
---|
560 | if( pcCU->getSlice()->getPPS()->getUseDQP()) |
---|
561 | { |
---|
562 | pcCU->setQPSubParts( getdQPFlag()?pcCU->getRefQP(uiAbsPartIdx):pcCU->getCodedQP(), uiAbsPartIdx, uiDepth ); // set QP |
---|
563 | } |
---|
564 | |
---|
565 | if (pcCU->getSlice()->getUseChromaQpAdj() && !getIsChromaQpAdjCoded()) |
---|
566 | { |
---|
567 | pcCU->setChromaQpAdjSubParts( pcCU->getCodedChromaQpAdj(), uiAbsPartIdx, uiDepth ); // set QP |
---|
568 | } |
---|
569 | |
---|
570 | isLastCtuOfSliceSegment = xDecodeSliceEnd( pcCU, uiAbsPartIdx ); |
---|
571 | } |
---|
572 | |
---|
573 | Void TDecCu::xDecompressCU( TComDataCU* pCtu, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
574 | { |
---|
575 | TComPic* pcPic = pCtu->getPic(); |
---|
576 | #if !H_3D_IV_MERGE |
---|
577 | TComSlice * pcSlice = pCtu->getSlice(); |
---|
578 | const TComSPS &sps=*(pcSlice->getSPS()); |
---|
579 | |
---|
580 | Bool bBoundary = false; |
---|
581 | UInt uiLPelX = pCtu->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; |
---|
582 | UInt uiRPelX = uiLPelX + (sps.getMaxCUWidth()>>uiDepth) - 1; |
---|
583 | UInt uiTPelY = pCtu->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; |
---|
584 | UInt uiBPelY = uiTPelY + (sps.getMaxCUHeight()>>uiDepth) - 1; |
---|
585 | |
---|
586 | if( ( uiRPelX >= sps.getPicWidthInLumaSamples() ) || ( uiBPelY >= sps.getPicHeightInLumaSamples() ) ) |
---|
587 | { |
---|
588 | bBoundary = true; |
---|
589 | } |
---|
590 | |
---|
591 | if( ( ( uiDepth < pCtu->getDepth( uiAbsPartIdx ) ) && ( uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() ) ) || bBoundary ) |
---|
592 | { |
---|
593 | UInt uiNextDepth = uiDepth + 1; |
---|
594 | UInt uiQNumParts = pCtu->getTotalNumPart() >> (uiNextDepth<<1); |
---|
595 | UInt uiIdx = uiAbsPartIdx; |
---|
596 | for ( UInt uiPartIdx = 0; uiPartIdx < 4; uiPartIdx++ ) |
---|
597 | { |
---|
598 | uiLPelX = pCtu->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiIdx] ]; |
---|
599 | uiTPelY = pCtu->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiIdx] ]; |
---|
600 | |
---|
601 | if( ( uiLPelX < sps.getPicWidthInLumaSamples() ) && ( uiTPelY < sps.getPicHeightInLumaSamples() ) ) |
---|
602 | { |
---|
603 | xDecompressCU(pCtu, uiIdx, uiNextDepth ); |
---|
604 | } |
---|
605 | |
---|
606 | uiIdx += uiQNumParts; |
---|
607 | } |
---|
608 | return; |
---|
609 | } |
---|
610 | #endif |
---|
611 | // Residual reconstruction |
---|
612 | m_ppcYuvResi[uiDepth]->clear(); |
---|
613 | |
---|
614 | m_ppcCU[uiDepth]->copySubCU( pCtu, uiAbsPartIdx ); |
---|
615 | |
---|
616 | switch( m_ppcCU[uiDepth]->getPredictionMode(0) ) |
---|
617 | { |
---|
618 | case MODE_INTER: |
---|
619 | #if H_3D_DBBP |
---|
620 | if( m_ppcCU[uiDepth]->getDBBPFlag(0) ) |
---|
621 | { |
---|
622 | xReconInterDBBP( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); |
---|
623 | } |
---|
624 | else |
---|
625 | { |
---|
626 | #endif |
---|
627 | #if H_3D_INTER_SDC |
---|
628 | if( m_ppcCU[uiDepth]->getSDCFlag( 0 ) ) |
---|
629 | { |
---|
630 | xReconInterSDC( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); |
---|
631 | } |
---|
632 | else |
---|
633 | { |
---|
634 | #endif |
---|
635 | xReconInter( m_ppcCU[uiDepth], uiDepth ); |
---|
636 | #if H_3D_INTER_SDC |
---|
637 | } |
---|
638 | #endif |
---|
639 | #if H_3D_DBBP |
---|
640 | } |
---|
641 | #endif |
---|
642 | break; |
---|
643 | case MODE_INTRA: |
---|
644 | #if H_3D |
---|
645 | if( m_ppcCU[uiDepth]->getDISFlag(0) ) |
---|
646 | { |
---|
647 | xReconDIS( m_ppcCU[uiDepth], 0, uiDepth ); |
---|
648 | } |
---|
649 | #if H_3D_DIM_SDC |
---|
650 | else if( m_ppcCU[uiDepth]->getSDCFlag(0) ) |
---|
651 | { |
---|
652 | xReconIntraSDC( m_ppcCU[uiDepth], 0, uiDepth ); |
---|
653 | } |
---|
654 | #endif |
---|
655 | else |
---|
656 | #endif |
---|
657 | xReconIntraQT( m_ppcCU[uiDepth], uiDepth ); |
---|
658 | break; |
---|
659 | default: |
---|
660 | assert(0); |
---|
661 | break; |
---|
662 | } |
---|
663 | |
---|
664 | #if DEBUG_STRING |
---|
665 | const PredMode predMode=m_ppcCU[uiDepth]->getPredictionMode(0); |
---|
666 | if (DebugOptionList::DebugString_Structure.getInt()&DebugStringGetPredModeMask(predMode)) |
---|
667 | { |
---|
668 | PartSize eSize=m_ppcCU[uiDepth]->getPartitionSize(0); |
---|
669 | std::ostream &ss(std::cout); |
---|
670 | |
---|
671 | ss <<"###: " << (predMode==MODE_INTRA?"Intra ":"Inter ") << partSizeToString[eSize] << " CU at " << m_ppcCU[uiDepth]->getCUPelX() << ", " << m_ppcCU[uiDepth]->getCUPelY() << " width=" << UInt(m_ppcCU[uiDepth]->getWidth(0)) << std::endl; |
---|
672 | } |
---|
673 | #endif |
---|
674 | |
---|
675 | if ( m_ppcCU[uiDepth]->isLosslessCoded(0) && (m_ppcCU[uiDepth]->getIPCMFlag(0) == false)) |
---|
676 | { |
---|
677 | xFillPCMBuffer(m_ppcCU[uiDepth], uiDepth); |
---|
678 | } |
---|
679 | |
---|
680 | xCopyToPic( m_ppcCU[uiDepth], pcPic, uiAbsPartIdx, uiDepth ); |
---|
681 | } |
---|
682 | |
---|
683 | Void TDecCu::xReconInter( TComDataCU* pcCU, UInt uiDepth ) |
---|
684 | { |
---|
685 | |
---|
686 | // inter prediction |
---|
687 | m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] ); |
---|
688 | |
---|
689 | #if DEBUG_STRING |
---|
690 | const Int debugPredModeMask=DebugStringGetPredModeMask(MODE_INTER); |
---|
691 | if (DebugOptionList::DebugString_Pred.getInt()&debugPredModeMask) |
---|
692 | { |
---|
693 | printBlockToStream(std::cout, "###inter-pred: ", *(m_ppcYuvReco[uiDepth])); |
---|
694 | } |
---|
695 | #endif |
---|
696 | |
---|
697 | // inter recon |
---|
698 | xDecodeInterTexture( pcCU, uiDepth ); |
---|
699 | |
---|
700 | #if DEBUG_STRING |
---|
701 | if (DebugOptionList::DebugString_Resi.getInt()&debugPredModeMask) |
---|
702 | { |
---|
703 | printBlockToStream(std::cout, "###inter-resi: ", *(m_ppcYuvResi[uiDepth])); |
---|
704 | } |
---|
705 | #endif |
---|
706 | |
---|
707 | // clip for only non-zero cbp case |
---|
708 | if ( pcCU->getQtRootCbf( 0) ) |
---|
709 | { |
---|
710 | m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ), pcCU->getSlice()->getSPS()->getBitDepths() ); |
---|
711 | } |
---|
712 | else |
---|
713 | { |
---|
714 | m_ppcYuvReco[uiDepth]->copyPartToPartYuv( m_ppcYuvReco[uiDepth],0, pcCU->getWidth( 0 ),pcCU->getHeight( 0 )); |
---|
715 | } |
---|
716 | #if DEBUG_STRING |
---|
717 | if (DebugOptionList::DebugString_Reco.getInt()&debugPredModeMask) |
---|
718 | { |
---|
719 | printBlockToStream(std::cout, "###inter-reco: ", *(m_ppcYuvReco[uiDepth])); |
---|
720 | } |
---|
721 | #endif |
---|
722 | |
---|
723 | } |
---|
724 | |
---|
725 | #if H_3D |
---|
726 | Void TDecCu::xReconDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
727 | { |
---|
728 | UInt uiWidth = pcCU->getWidth ( 0 ); |
---|
729 | UInt uiHeight = pcCU->getHeight ( 0 ); |
---|
730 | |
---|
731 | TComYuv* pcRecoYuv = m_ppcYuvReco[uiDepth]; |
---|
732 | |
---|
733 | UInt uiStride = pcRecoYuv->getStride (); |
---|
734 | Pel* piReco = pcRecoYuv->getLumaAddr( uiAbsPartIdx ); |
---|
735 | |
---|
736 | |
---|
737 | AOF( uiWidth == uiHeight ); |
---|
738 | AOF( uiAbsPartIdx == 0 ); |
---|
739 | |
---|
740 | Bool bAboveAvail = false; |
---|
741 | Bool bLeftAvail = false; |
---|
742 | pcCU->getPattern()->initPattern ( pcCU, 0, uiAbsPartIdx ); |
---|
743 | pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0, |
---|
744 | m_pcPrediction->getPredicBuf (), |
---|
745 | m_pcPrediction->getPredicBufWidth (), |
---|
746 | m_pcPrediction->getPredicBufHeight (), |
---|
747 | bAboveAvail, bLeftAvail |
---|
748 | ); |
---|
749 | |
---|
750 | if ( pcCU->getDISType(uiAbsPartIdx) == 0 ) |
---|
751 | { |
---|
752 | m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), VER_IDX, piReco, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); |
---|
753 | } |
---|
754 | else if ( pcCU->getDISType(uiAbsPartIdx) == 1 ) |
---|
755 | { |
---|
756 | m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), HOR_IDX, piReco, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); |
---|
757 | } |
---|
758 | else if ( pcCU->getDISType(uiAbsPartIdx) == 2 ) |
---|
759 | { |
---|
760 | Pel pSingleDepth = 1 << ( g_bitDepthY - 1 ); |
---|
761 | pcCU->getNeighDepth ( 0, 0, &pSingleDepth, 0 ); |
---|
762 | for( UInt uiY = 0; uiY < uiHeight; uiY++ ) |
---|
763 | { |
---|
764 | for( UInt uiX = 0; uiX < uiWidth; uiX++ ) |
---|
765 | { |
---|
766 | piReco[ uiX ] = pSingleDepth; |
---|
767 | } |
---|
768 | piReco+= uiStride; |
---|
769 | } |
---|
770 | } |
---|
771 | else if ( pcCU->getDISType(uiAbsPartIdx) == 3 ) |
---|
772 | { |
---|
773 | Pel pSingleDepth = 1 << ( g_bitDepthY - 1 ); |
---|
774 | pcCU->getNeighDepth ( 0, 0, &pSingleDepth, 1 ); |
---|
775 | for( UInt uiY = 0; uiY < uiHeight; uiY++ ) |
---|
776 | { |
---|
777 | for( UInt uiX = 0; uiX < uiWidth; uiX++ ) |
---|
778 | { |
---|
779 | piReco[ uiX ] = pSingleDepth; |
---|
780 | } |
---|
781 | piReco+= uiStride; |
---|
782 | } |
---|
783 | } |
---|
784 | |
---|
785 | // clear UV |
---|
786 | UInt uiStrideC = pcRecoYuv->getCStride(); |
---|
787 | Pel *pRecCb = pcRecoYuv->getCbAddr(); |
---|
788 | Pel *pRecCr = pcRecoYuv->getCrAddr(); |
---|
789 | |
---|
790 | for (Int y=0; y<uiHeight/2; y++) |
---|
791 | { |
---|
792 | for (Int x=0; x<uiWidth/2; x++) |
---|
793 | { |
---|
794 | pRecCb[x] = 1<<(g_bitDepthC-1); |
---|
795 | pRecCr[x] = 1<<(g_bitDepthC-1); |
---|
796 | } |
---|
797 | |
---|
798 | pRecCb += uiStrideC; |
---|
799 | pRecCr += uiStrideC; |
---|
800 | } |
---|
801 | } |
---|
802 | #endif |
---|
803 | #if H_3D_INTER_SDC |
---|
804 | Void TDecCu::xReconInterSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
805 | { |
---|
806 | // inter prediction |
---|
807 | m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] ); |
---|
808 | |
---|
809 | UInt uiWidth = pcCU->getWidth ( 0 ); |
---|
810 | UInt uiHeight = pcCU->getHeight( 0 ); |
---|
811 | |
---|
812 | Pel *pResi; |
---|
813 | UInt uiPelX, uiPelY; |
---|
814 | UInt uiResiStride = m_ppcYuvResi[uiDepth]->getStride(); |
---|
815 | |
---|
816 | pResi = m_ppcYuvResi[uiDepth]->getLumaAddr( 0 ); |
---|
817 | for( uiPelY = 0; uiPelY < uiHeight; uiPelY++ ) |
---|
818 | { |
---|
819 | for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ ) |
---|
820 | { |
---|
821 | pResi[ uiPelX ] = pcCU->getSDCSegmentDCOffset( 0, 0 ); |
---|
822 | } |
---|
823 | pResi += uiResiStride; |
---|
824 | } |
---|
825 | |
---|
826 | m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ) ); |
---|
827 | |
---|
828 | // clear UV |
---|
829 | UInt uiStrideC = m_ppcYuvReco[uiDepth]->getCStride(); |
---|
830 | Pel *pRecCb = m_ppcYuvReco[uiDepth]->getCbAddr(); |
---|
831 | Pel *pRecCr = m_ppcYuvReco[uiDepth]->getCrAddr(); |
---|
832 | |
---|
833 | for (Int y = 0; y < uiHeight/2; y++) |
---|
834 | { |
---|
835 | for (Int x = 0; x < uiWidth/2; x++) |
---|
836 | { |
---|
837 | pRecCb[x] = (Pel)( 1 << ( g_bitDepthC - 1 ) ); |
---|
838 | pRecCr[x] = (Pel)( 1 << ( g_bitDepthC - 1 ) ); |
---|
839 | } |
---|
840 | |
---|
841 | pRecCb += uiStrideC; |
---|
842 | pRecCr += uiStrideC; |
---|
843 | } |
---|
844 | } |
---|
845 | #endif |
---|
846 | |
---|
847 | #if H_3D_DBBP |
---|
848 | Void TDecCu::xReconInterDBBP( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
849 | { |
---|
850 | AOF(!pcCU->getSlice()->getIsDepth()); |
---|
851 | AOF(!pcCU->getSlice()->isIntra()); |
---|
852 | PartSize ePartSize = pcCU->getPartitionSize( 0 ); |
---|
853 | |
---|
854 | // get collocated depth block |
---|
855 | UInt uiDepthStride = 0; |
---|
856 | #if H_3D_FCO |
---|
857 | Pel* pDepthPels = pcCU->getVirtualDepthBlock(pcCU->getZorderIdxInCU(), pcCU->getWidth(0), pcCU->getHeight(0), uiDepthStride); |
---|
858 | #else |
---|
859 | Pel* pDepthPels = pcCU->getVirtualDepthBlock(0, pcCU->getWidth(0), pcCU->getHeight(0), uiDepthStride); |
---|
860 | #endif |
---|
861 | AOF( pDepthPels != NULL ); |
---|
862 | AOF( uiDepthStride != 0 ); |
---|
863 | |
---|
864 | // compute mask by segmenting depth block |
---|
865 | Bool pMask[MAX_CU_SIZE*MAX_CU_SIZE]; |
---|
866 | Bool bValidMask = m_pcPrediction->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, pcCU->getWidth(0), pcCU->getHeight(0), pMask, pcCU); |
---|
867 | AOF(bValidMask); |
---|
868 | |
---|
869 | DbbpTmpData* pDBBPTmpData = pcCU->getDBBPTmpData(); |
---|
870 | TComYuv* apSegPredYuv[2] = { m_ppcYuvReco[uiDepth], m_ppcYuvRecoDBBP[uiDepth] }; |
---|
871 | |
---|
872 | // first, extract the two sets of motion parameters |
---|
873 | UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxCUDepth() - uiDepth ) << 1 ) ) >> 4; |
---|
874 | for( UInt uiSegment = 0; uiSegment < 2; uiSegment++ ) |
---|
875 | { |
---|
876 | UInt uiPartAddr = uiSegment*uiPUOffset; |
---|
877 | |
---|
878 | pDBBPTmpData->auhInterDir[uiSegment] = pcCU->getInterDir(uiPartAddr); |
---|
879 | |
---|
880 | for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) |
---|
881 | { |
---|
882 | RefPicList eRefList = (RefPicList)uiRefListIdx; |
---|
883 | pcCU->getMvField(pcCU, uiPartAddr, eRefList, pDBBPTmpData->acMvField[uiSegment][eRefList]); |
---|
884 | } |
---|
885 | |
---|
886 | AOF( pcCU->getARPW(uiPartAddr) == 0 ); |
---|
887 | AOF( pcCU->getICFlag(uiPartAddr) == false ); |
---|
888 | AOF( pcCU->getSPIVMPFlag(uiPartAddr) == false ); |
---|
889 | AOF( pcCU->getVSPFlag(uiPartAddr) == 0 ); |
---|
890 | } |
---|
891 | |
---|
892 | // do motion compensation for each segment as 2Nx2N |
---|
893 | pcCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); |
---|
894 | pcCU->setPredModeSubParts( MODE_INTER, 0, uiDepth ); |
---|
895 | for( UInt uiSegment = 0; uiSegment < 2; uiSegment++ ) |
---|
896 | { |
---|
897 | pcCU->setInterDirSubParts( pDBBPTmpData->auhInterDir[uiSegment], 0, 0, uiDepth ); |
---|
898 | |
---|
899 | for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) |
---|
900 | { |
---|
901 | RefPicList eRefList = (RefPicList)uiRefListIdx; |
---|
902 | |
---|
903 | pcCU->getCUMvField( eRefList )->setAllMvField( pDBBPTmpData->acMvField[uiSegment][eRefList], SIZE_2Nx2N, 0, 0 ); |
---|
904 | } |
---|
905 | |
---|
906 | // inter prediction |
---|
907 | m_pcPrediction->motionCompensation( pcCU, apSegPredYuv[uiSegment] ); |
---|
908 | } |
---|
909 | |
---|
910 | // restore motion information in both segments again |
---|
911 | pcCU->setPartSizeSubParts( ePartSize, 0, uiDepth ); |
---|
912 | pcCU->setPredModeSubParts( MODE_INTER, 0, uiDepth ); |
---|
913 | for( UInt uiSegment = 0; uiSegment < 2; uiSegment++ ) |
---|
914 | { |
---|
915 | UInt uiPartAddr = uiSegment*uiPUOffset; |
---|
916 | |
---|
917 | pcCU->setDBBPFlagSubParts(true, uiPartAddr, uiSegment, uiDepth); |
---|
918 | pcCU->setInterDirSubParts(pDBBPTmpData->auhInterDir[uiSegment], uiPartAddr, uiSegment, uiDepth); // interprets depth relative to LCU level |
---|
919 | |
---|
920 | for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) |
---|
921 | { |
---|
922 | RefPicList eRefList = (RefPicList)uiRefListIdx; |
---|
923 | |
---|
924 | pcCU->getCUMvField( eRefList )->setAllMvField( pDBBPTmpData->acMvField[uiSegment][eRefList], ePartSize, uiPartAddr, 0, uiSegment ); // interprets depth relative to rpcTempCU level |
---|
925 | } |
---|
926 | } |
---|
927 | |
---|
928 | // reconstruct final prediction signal by combining both segments |
---|
929 | m_pcPrediction->combineSegmentsWithMask(apSegPredYuv, m_ppcYuvReco[uiDepth], pMask, pcCU->getWidth(0), pcCU->getHeight(0), 0, ePartSize); |
---|
930 | |
---|
931 | // inter recon |
---|
932 | xDecodeInterTexture( pcCU, 0, uiDepth ); |
---|
933 | |
---|
934 | // clip for only non-zero cbp case |
---|
935 | if ( ( pcCU->getCbf( 0, TEXT_LUMA ) ) || ( pcCU->getCbf( 0, TEXT_CHROMA_U ) ) || ( pcCU->getCbf(0, TEXT_CHROMA_V ) ) ) |
---|
936 | { |
---|
937 | m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ) ); |
---|
938 | } |
---|
939 | else |
---|
940 | { |
---|
941 | m_ppcYuvReco[uiDepth]->copyPartToPartYuv( m_ppcYuvReco[uiDepth],0, pcCU->getWidth( 0 ),pcCU->getHeight( 0 )); |
---|
942 | } |
---|
943 | } |
---|
944 | #endif |
---|
945 | |
---|
946 | |
---|
947 | Void |
---|
948 | TDecCu::xIntraRecBlk( TComYuv* pcRecoYuv, |
---|
949 | TComYuv* pcPredYuv, |
---|
950 | TComYuv* pcResiYuv, |
---|
951 | const ComponentID compID, |
---|
952 | TComTU &rTu) |
---|
953 | { |
---|
954 | if (!rTu.ProcessComponentSection(compID)) |
---|
955 | { |
---|
956 | return; |
---|
957 | } |
---|
958 | const Bool bIsLuma = isLuma(compID); |
---|
959 | |
---|
960 | |
---|
961 | TComDataCU *pcCU = rTu.getCU(); |
---|
962 | const TComSPS &sps=*(pcCU->getSlice()->getSPS()); |
---|
963 | const UInt uiAbsPartIdx=rTu.GetAbsPartIdxTU(); |
---|
964 | |
---|
965 | const TComRectangle &tuRect =rTu.getRect(compID); |
---|
966 | const UInt uiWidth = tuRect.width; |
---|
967 | const UInt uiHeight = tuRect.height; |
---|
968 | const UInt uiStride = pcRecoYuv->getStride (compID); |
---|
969 | Pel* piPred = pcPredYuv->getAddr( compID, uiAbsPartIdx ); |
---|
970 | const ChromaFormat chFmt = rTu.GetChromaFormat(); |
---|
971 | |
---|
972 | if (uiWidth != uiHeight) |
---|
973 | { |
---|
974 | //------------------------------------------------ |
---|
975 | |
---|
976 | //split at current level if dividing into square sub-TUs |
---|
977 | |
---|
978 | TComTURecurse subTURecurse(rTu, false, TComTU::VERTICAL_SPLIT, true, compID); |
---|
979 | |
---|
980 | //recurse further |
---|
981 | do |
---|
982 | { |
---|
983 | xIntraRecBlk(pcRecoYuv, pcPredYuv, pcResiYuv, compID, subTURecurse); |
---|
984 | } while (subTURecurse.nextSection(rTu)); |
---|
985 | |
---|
986 | //------------------------------------------------ |
---|
987 | |
---|
988 | return; |
---|
989 | } |
---|
990 | |
---|
991 | const UInt uiChPredMode = pcCU->getIntraDir( toChannelType(compID), uiAbsPartIdx ); |
---|
992 | const UInt partsPerMinCU = 1<<(2*(sps.getMaxTotalCUDepth() - sps.getLog2DiffMaxMinCodingBlockSize())); |
---|
993 | const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && !bIsLuma) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt, partsPerMinCU)) : uiChPredMode; |
---|
994 | const UInt uiChFinalMode = ((chFmt == CHROMA_422) && !bIsLuma) ? g_chroma422IntraAngleMappingTable[uiChCodedMode] : uiChCodedMode; |
---|
995 | |
---|
996 | //===== init availability pattern ===== |
---|
997 | Bool bAboveAvail = false; |
---|
998 | Bool bLeftAvail = false; |
---|
999 | |
---|
1000 | const Bool bUseFilteredPredictions=TComPrediction::filteringIntraReferenceSamples(compID, uiChFinalMode, uiWidth, uiHeight, chFmt, pcCU->getSlice()->getSPS()->getSpsRangeExtension().getIntraSmoothingDisabledFlag()); |
---|
1001 | |
---|
1002 | #if DEBUG_STRING |
---|
1003 | std::ostream &ss(std::cout); |
---|
1004 | #endif |
---|
1005 | |
---|
1006 | DEBUG_STRING_NEW(sTemp) |
---|
1007 | m_pcPrediction->initIntraPatternChType( rTu, bAboveAvail, bLeftAvail, compID, bUseFilteredPredictions DEBUG_STRING_PASS_INTO(sTemp) ); |
---|
1008 | |
---|
1009 | |
---|
1010 | //===== get prediction signal ===== |
---|
1011 | #if H_3D_DIM |
---|
1012 | if( isDimMode( uiLumaPredMode ) ) |
---|
1013 | { |
---|
1014 | m_pcPrediction->predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight ); |
---|
1015 | } |
---|
1016 | else |
---|
1017 | { |
---|
1018 | #endif |
---|
1019 | |
---|
1020 | m_pcPrediction->predIntraAng( compID, uiChFinalMode, 0 /* Decoder does not have an original image */, 0, piPred, uiStride, rTu, bAboveAvail, bLeftAvail, bUseFilteredPredictions ); |
---|
1021 | #if H_3D_DIM |
---|
1022 | } |
---|
1023 | #endif |
---|
1024 | |
---|
1025 | #if DEBUG_STRING |
---|
1026 | ss << sTemp; |
---|
1027 | #endif |
---|
1028 | |
---|
1029 | //===== inverse transform ===== |
---|
1030 | Pel* piResi = pcResiYuv->getAddr( compID, uiAbsPartIdx ); |
---|
1031 | TCoeff* pcCoeff = pcCU->getCoeff(compID) + rTu.getCoefficientOffset(compID);//( uiNumCoeffInc * uiAbsPartIdx ); |
---|
1032 | |
---|
1033 | const QpParam cQP(*pcCU, compID); |
---|
1034 | |
---|
1035 | |
---|
1036 | DEBUG_STRING_NEW(sDebug); |
---|
1037 | #if DEBUG_STRING |
---|
1038 | const Int debugPredModeMask=DebugStringGetPredModeMask(MODE_INTRA); |
---|
1039 | std::string *psDebug=(DebugOptionList::DebugString_InvTran.getInt()&debugPredModeMask) ? &sDebug : 0; |
---|
1040 | #endif |
---|
1041 | #if H_3D |
---|
1042 | Bool useDltFlag = (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()); |
---|
1043 | |
---|
1044 | if ( pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrDepth ) || useDltFlag ) |
---|
1045 | #else |
---|
1046 | if (pcCU->getCbf(uiAbsPartIdx, compID, rTu.GetTransformDepthRel()) != 0) |
---|
1047 | #endif |
---|
1048 | { |
---|
1049 | m_pcTrQuant->invTransformNxN( rTu, compID, piResi, uiStride, pcCoeff, cQP DEBUG_STRING_PASS_INTO(psDebug) ); |
---|
1050 | } |
---|
1051 | else |
---|
1052 | { |
---|
1053 | for (UInt y = 0; y < uiHeight; y++) |
---|
1054 | { |
---|
1055 | for (UInt x = 0; x < uiWidth; x++) |
---|
1056 | { |
---|
1057 | piResi[(y * uiStride) + x] = 0; |
---|
1058 | } |
---|
1059 | } |
---|
1060 | } |
---|
1061 | |
---|
1062 | #if DEBUG_STRING |
---|
1063 | if (psDebug) |
---|
1064 | { |
---|
1065 | ss << (*psDebug); |
---|
1066 | } |
---|
1067 | #endif |
---|
1068 | |
---|
1069 | //===== reconstruction ===== |
---|
1070 | const UInt uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride(compID); |
---|
1071 | |
---|
1072 | const Bool useCrossComponentPrediction = isChroma(compID) && (pcCU->getCrossComponentPredictionAlpha(uiAbsPartIdx, compID) != 0); |
---|
1073 | const Pel* pResiLuma = pcResiYuv->getAddr( COMPONENT_Y, uiAbsPartIdx ); |
---|
1074 | const Int strideLuma = pcResiYuv->getStride( COMPONENT_Y ); |
---|
1075 | |
---|
1076 | Pel* pPred = piPred; |
---|
1077 | Pel* pResi = piResi; |
---|
1078 | Pel* pReco = pcRecoYuv->getAddr( compID, uiAbsPartIdx ); |
---|
1079 | Pel* pRecIPred = pcCU->getPic()->getPicYuvRec()->getAddr( compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + uiAbsPartIdx ); |
---|
1080 | |
---|
1081 | |
---|
1082 | #if DEBUG_STRING |
---|
1083 | const Bool bDebugPred=((DebugOptionList::DebugString_Pred.getInt()&debugPredModeMask) && DEBUG_STRING_CHANNEL_CONDITION(compID)); |
---|
1084 | const Bool bDebugResi=((DebugOptionList::DebugString_Resi.getInt()&debugPredModeMask) && DEBUG_STRING_CHANNEL_CONDITION(compID)); |
---|
1085 | const Bool bDebugReco=((DebugOptionList::DebugString_Reco.getInt()&debugPredModeMask) && DEBUG_STRING_CHANNEL_CONDITION(compID)); |
---|
1086 | if (bDebugPred || bDebugResi || bDebugReco) |
---|
1087 | { |
---|
1088 | ss << "###: " << "CompID: " << compID << " pred mode (ch/fin): " << uiChPredMode << "/" << uiChFinalMode << " absPartIdx: " << rTu.GetAbsPartIdxTU() << std::endl; |
---|
1089 | } |
---|
1090 | #endif |
---|
1091 | |
---|
1092 | const Int clipbd = sps.getBitDepth(toChannelType(compID)); |
---|
1093 | #if O0043_BEST_EFFORT_DECODING |
---|
1094 | const Int bitDepthDelta = sps.getStreamBitDepth(toChannelType(compID)) - clipbd; |
---|
1095 | #endif |
---|
1096 | |
---|
1097 | if( useCrossComponentPrediction ) |
---|
1098 | { |
---|
1099 | TComTrQuant::crossComponentPrediction( rTu, compID, pResiLuma, piResi, piResi, uiWidth, uiHeight, strideLuma, uiStride, uiStride, true ); |
---|
1100 | } |
---|
1101 | |
---|
1102 | for( UInt uiY = 0; uiY < uiHeight; uiY++ ) |
---|
1103 | { |
---|
1104 | #if DEBUG_STRING |
---|
1105 | if (bDebugPred || bDebugResi || bDebugReco) |
---|
1106 | { |
---|
1107 | ss << "###: "; |
---|
1108 | } |
---|
1109 | |
---|
1110 | if (bDebugPred) |
---|
1111 | { |
---|
1112 | ss << " - pred: "; |
---|
1113 | for( UInt uiX = 0; uiX < uiWidth; uiX++ ) |
---|
1114 | { |
---|
1115 | ss << pPred[ uiX ] << ", "; |
---|
1116 | } |
---|
1117 | } |
---|
1118 | if (bDebugResi) |
---|
1119 | { |
---|
1120 | ss << " - resi: "; |
---|
1121 | } |
---|
1122 | #endif |
---|
1123 | |
---|
1124 | for( UInt uiX = 0; uiX < uiWidth; uiX++ ) |
---|
1125 | { |
---|
1126 | #if DEBUG_STRING |
---|
1127 | if (bDebugResi) |
---|
1128 | { |
---|
1129 | ss << pResi[ uiX ] << ", "; |
---|
1130 | } |
---|
1131 | #endif |
---|
1132 | #if O0043_BEST_EFFORT_DECODING |
---|
1133 | pReco [ uiX ] = ClipBD( rightShiftEvenRounding<Pel>(pPred[ uiX ] + pResi[ uiX ], bitDepthDelta), clipbd ); |
---|
1134 | #else |
---|
1135 | pReco [ uiX ] = ClipBD( pPred[ uiX ] + pResi[ uiX ], clipbd ); |
---|
1136 | #endif |
---|
1137 | pRecIPred[ uiX ] = pReco[ uiX ]; |
---|
1138 | } |
---|
1139 | #if DEBUG_STRING |
---|
1140 | if (bDebugReco) |
---|
1141 | { |
---|
1142 | ss << " - reco: "; |
---|
1143 | for( UInt uiX = 0; uiX < uiWidth; uiX++ ) |
---|
1144 | { |
---|
1145 | ss << pReco[ uiX ] << ", "; |
---|
1146 | } |
---|
1147 | } |
---|
1148 | |
---|
1149 | if (bDebugPred || bDebugResi || bDebugReco) |
---|
1150 | { |
---|
1151 | ss << "\n"; |
---|
1152 | } |
---|
1153 | #endif |
---|
1154 | pPred += uiStride; |
---|
1155 | pResi += uiStride; |
---|
1156 | pReco += uiStride; |
---|
1157 | pRecIPred += uiRecIPredStride; |
---|
1158 | } |
---|
1159 | } |
---|
1160 | #if H_3D_DIM |
---|
1161 | mapDepthModeToIntraDir( uiChromaPredMode ); |
---|
1162 | #endif |
---|
1163 | |
---|
1164 | |
---|
1165 | Void |
---|
1166 | TDecCu::xReconIntraQT( TComDataCU* pcCU, UInt uiDepth ) |
---|
1167 | { |
---|
1168 | if (pcCU->getIPCMFlag(0)) |
---|
1169 | { |
---|
1170 | xReconPCM( pcCU, uiDepth ); |
---|
1171 | return; |
---|
1172 | } |
---|
1173 | const UInt numChType = pcCU->getPic()->getChromaFormat()!=CHROMA_400 ? 2 : 1; |
---|
1174 | for (UInt chType=CHANNEL_TYPE_LUMA; chType<numChType; chType++) |
---|
1175 | { |
---|
1176 | const ChannelType chanType=ChannelType(chType); |
---|
1177 | const Bool NxNPUHas4Parts = ::isChroma(chanType) ? enable4ChromaPUsInIntraNxNCU(pcCU->getPic()->getChromaFormat()) : true; |
---|
1178 | const UInt uiInitTrDepth = ( pcCU->getPartitionSize(0) != SIZE_2Nx2N && NxNPUHas4Parts ? 1 : 0 ); |
---|
1179 | |
---|
1180 | TComTURecurse tuRecurseCU(pcCU, 0); |
---|
1181 | TComTURecurse tuRecurseWithPU(tuRecurseCU, false, (uiInitTrDepth==0)?TComTU::DONT_SPLIT : TComTU::QUAD_SPLIT); |
---|
1182 | |
---|
1183 | do |
---|
1184 | { |
---|
1185 | xIntraRecQT( m_ppcYuvReco[uiDepth], m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], chanType, tuRecurseWithPU ); |
---|
1186 | } while (tuRecurseWithPU.nextSection(tuRecurseCU)); |
---|
1187 | } |
---|
1188 | } |
---|
1189 | |
---|
1190 | #if H_3D_DIM_SDC |
---|
1191 | Void TDecCu::xReconIntraSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
1192 | { |
---|
1193 | UInt uiWidth = pcCU->getWidth ( 0 ); |
---|
1194 | UInt uiHeight = pcCU->getHeight ( 0 ); |
---|
1195 | TComWedgelet* dmm4SegmentationOrg = new TComWedgelet( uiWidth, uiHeight ); |
---|
1196 | UInt numParts = 1; |
---|
1197 | UInt sdcDepth = 0; |
---|
1198 | TComYuv* pcRecoYuv = m_ppcYuvReco[uiDepth]; |
---|
1199 | TComYuv* pcPredYuv = m_ppcYuvReco[uiDepth]; |
---|
1200 | TComYuv* pcResiYuv = m_ppcYuvResi[uiDepth]; |
---|
1201 | |
---|
1202 | UInt uiStride = 0; |
---|
1203 | Pel* piReco; |
---|
1204 | Pel* piPred; |
---|
1205 | Pel* piResi; |
---|
1206 | |
---|
1207 | UInt uiZOrder; |
---|
1208 | Pel* piRecIPred; |
---|
1209 | UInt uiRecIPredStride; |
---|
1210 | |
---|
1211 | UInt uiLumaPredMode = 0; |
---|
1212 | |
---|
1213 | if ((uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize()) > 1) |
---|
1214 | { |
---|
1215 | numParts = uiWidth * uiWidth >> (2 * pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize()); |
---|
1216 | sdcDepth = g_aucConvertToBit[uiWidth] + 2 - pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize(); |
---|
1217 | uiWidth = uiHeight = (1 << pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize()); |
---|
1218 | } |
---|
1219 | |
---|
1220 | for ( Int i = 0; i < numParts; i++ ) |
---|
1221 | { |
---|
1222 | uiStride = pcRecoYuv->getStride (); |
---|
1223 | piReco = pcRecoYuv->getLumaAddr( uiAbsPartIdx ); |
---|
1224 | piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); |
---|
1225 | piResi = pcResiYuv->getLumaAddr( uiAbsPartIdx ); |
---|
1226 | |
---|
1227 | uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx; |
---|
1228 | piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); |
---|
1229 | uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); |
---|
1230 | |
---|
1231 | uiLumaPredMode = pcCU->getLumaIntraDir ( uiAbsPartIdx ); |
---|
1232 | |
---|
1233 | AOF( uiWidth == uiHeight ); |
---|
1234 | |
---|
1235 | //===== init availability pattern ===== |
---|
1236 | Bool bAboveAvail = false; |
---|
1237 | Bool bLeftAvail = false; |
---|
1238 | |
---|
1239 | pcCU->getPattern()->initPattern ( pcCU, sdcDepth, uiAbsPartIdx ); |
---|
1240 | pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, sdcDepth, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail ); |
---|
1241 | |
---|
1242 | TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight ); |
---|
1243 | //===== get prediction signal ===== |
---|
1244 | if( isDimMode( uiLumaPredMode ) ) |
---|
1245 | { |
---|
1246 | m_pcPrediction->predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, false, dmm4Segmentation ); |
---|
1247 | Bool* dmm4PatternSplit = dmm4Segmentation->getPattern(); |
---|
1248 | Bool* dmm4PatternOrg = dmm4SegmentationOrg->getPattern(); |
---|
1249 | for( UInt k = 0; k < (uiWidth*uiHeight); k++ ) |
---|
1250 | { |
---|
1251 | dmm4PatternOrg[k+(uiAbsPartIdx<<4)] = dmm4PatternSplit[k]; |
---|
1252 | } |
---|
1253 | } |
---|
1254 | else |
---|
1255 | { |
---|
1256 | m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); |
---|
1257 | } |
---|
1258 | |
---|
1259 | if ( numParts > 1 ) |
---|
1260 | { |
---|
1261 | for( UInt uiY = 0; uiY < uiHeight; uiY++ ) |
---|
1262 | { |
---|
1263 | for( UInt uiX = 0; uiX < uiWidth; uiX++ ) |
---|
1264 | { |
---|
1265 | piReco [ uiX ] = ClipY( piPred[ uiX ] ); |
---|
1266 | piRecIPred [ uiX ] = piReco[ uiX ]; |
---|
1267 | } |
---|
1268 | piPred += uiStride; |
---|
1269 | piReco += uiStride; |
---|
1270 | piRecIPred += uiRecIPredStride; |
---|
1271 | } |
---|
1272 | } |
---|
1273 | uiAbsPartIdx += ( (uiWidth * uiWidth) >> 4 ); |
---|
1274 | dmm4Segmentation->destroy(); delete dmm4Segmentation; |
---|
1275 | } |
---|
1276 | uiAbsPartIdx = 0; |
---|
1277 | |
---|
1278 | if ( numParts > 1 ) |
---|
1279 | { |
---|
1280 | uiWidth = pcCU->getWidth( 0 ); |
---|
1281 | uiHeight = pcCU->getHeight( 0 ); |
---|
1282 | } |
---|
1283 | piReco = pcRecoYuv->getLumaAddr( uiAbsPartIdx ); |
---|
1284 | piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); |
---|
1285 | piResi = pcResiYuv->getLumaAddr( uiAbsPartIdx ); |
---|
1286 | uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx; |
---|
1287 | piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); |
---|
1288 | uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); |
---|
1289 | // number of segments depends on prediction mode |
---|
1290 | UInt uiNumSegments = 1; |
---|
1291 | Bool* pbMask = NULL; |
---|
1292 | UInt uiMaskStride = 0; |
---|
1293 | |
---|
1294 | if( getDimType( uiLumaPredMode ) == DMM1_IDX ) |
---|
1295 | { |
---|
1296 | Int uiTabIdx = pcCU->getDmmWedgeTabIdx(DMM1_IDX, uiAbsPartIdx); |
---|
1297 | |
---|
1298 | WedgeList* pacWedgeList = pcCU->isDMM1UpscaleMode(uiWidth) ? &g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] : &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])]; |
---|
1299 | TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx )); |
---|
1300 | |
---|
1301 | uiNumSegments = 2; |
---|
1302 | |
---|
1303 | pbMask = pcCU->isDMM1UpscaleMode( uiWidth ) ? pcWedgelet->getScaledPattern(uiWidth) : pcWedgelet->getPattern(); |
---|
1304 | uiMaskStride = pcCU->isDMM1UpscaleMode( uiWidth ) ? uiWidth : pcWedgelet->getStride(); |
---|
1305 | } |
---|
1306 | if( getDimType( uiLumaPredMode ) == DMM4_IDX ) |
---|
1307 | { |
---|
1308 | uiNumSegments = 2; |
---|
1309 | pbMask = dmm4SegmentationOrg->getPattern(); |
---|
1310 | uiMaskStride = dmm4SegmentationOrg->getStride(); |
---|
1311 | } |
---|
1312 | // get DC prediction for each segment |
---|
1313 | Pel apDCPredValues[2]; |
---|
1314 | if ( getDimType( uiLumaPredMode ) == DMM1_IDX || getDimType( uiLumaPredMode ) == DMM4_IDX ) |
---|
1315 | { |
---|
1316 | apDCPredValues[0] = pcCU->getDmmPredictor( 0 ); |
---|
1317 | apDCPredValues[1] = pcCU->getDmmPredictor( 1 ); |
---|
1318 | } |
---|
1319 | else |
---|
1320 | { |
---|
1321 | m_pcPrediction->analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode); |
---|
1322 | } |
---|
1323 | |
---|
1324 | // reconstruct residual based on mask + DC residuals |
---|
1325 | Pel apDCResiValues[2]; |
---|
1326 | for( UInt uiSegment = 0; uiSegment < uiNumSegments; uiSegment++ ) |
---|
1327 | { |
---|
1328 | #if H_3D_DIM_DLT |
---|
1329 | Pel pPredIdx = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] ); |
---|
1330 | Pel pResiIdx = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx); |
---|
1331 | Pel pRecoValue = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pPredIdx + pResiIdx ); |
---|
1332 | |
---|
1333 | apDCResiValues[uiSegment] = pRecoValue - apDCPredValues[uiSegment]; |
---|
1334 | #else |
---|
1335 | apDCResiValues[uiSegment] = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx); |
---|
1336 | #endif |
---|
1337 | } |
---|
1338 | |
---|
1339 | //===== reconstruction ===== |
---|
1340 | Bool*pMask = pbMask; |
---|
1341 | Pel* pPred = piPred; |
---|
1342 | Pel* pResi = piResi; |
---|
1343 | Pel* pReco = piReco; |
---|
1344 | Pel* pRecIPred = piRecIPred; |
---|
1345 | |
---|
1346 | for( UInt uiY = 0; uiY < uiHeight; uiY++ ) |
---|
1347 | { |
---|
1348 | for( UInt uiX = 0; uiX < uiWidth; uiX++ ) |
---|
1349 | { |
---|
1350 | UChar ucSegment = pMask?(UChar)pMask[uiX]:0; |
---|
1351 | assert( ucSegment < uiNumSegments ); |
---|
1352 | |
---|
1353 | Pel pResiDC = apDCResiValues[ucSegment]; |
---|
1354 | |
---|
1355 | pReco [ uiX ] = ClipY( pPred[ uiX ] + pResiDC ); |
---|
1356 | pRecIPred[ uiX ] = pReco[ uiX ]; |
---|
1357 | } |
---|
1358 | pPred += uiStride; |
---|
1359 | pResi += uiStride; |
---|
1360 | pReco += uiStride; |
---|
1361 | pRecIPred += uiRecIPredStride; |
---|
1362 | pMask += uiMaskStride; |
---|
1363 | } |
---|
1364 | |
---|
1365 | // clear UV |
---|
1366 | UInt uiStrideC = pcPredYuv->getCStride(); |
---|
1367 | Pel *pRecCb = pcPredYuv->getCbAddr(); |
---|
1368 | Pel *pRecCr = pcPredYuv->getCrAddr(); |
---|
1369 | |
---|
1370 | for (Int y=0; y<uiHeight/2; y++) |
---|
1371 | { |
---|
1372 | for (Int x=0; x<uiWidth/2; x++) |
---|
1373 | { |
---|
1374 | pRecCb[x] = 128; |
---|
1375 | pRecCr[x] = 128; |
---|
1376 | } |
---|
1377 | |
---|
1378 | pRecCb += uiStrideC; |
---|
1379 | pRecCr += uiStrideC; |
---|
1380 | } |
---|
1381 | dmm4SegmentationOrg->destroy(); delete dmm4SegmentationOrg; |
---|
1382 | } |
---|
1383 | #endif |
---|
1384 | |
---|
1385 | |
---|
1386 | /** Function for deriving reconstructed PU/CU chroma samples with QTree structure |
---|
1387 | * \param pcRecoYuv pointer to reconstructed sample arrays |
---|
1388 | * \param pcPredYuv pointer to prediction sample arrays |
---|
1389 | * \param pcResiYuv pointer to residue sample arrays |
---|
1390 | * \param chType texture channel type (luma/chroma) |
---|
1391 | * \param rTu reference to transform data |
---|
1392 | * |
---|
1393 | \ This function derives reconstructed PU/CU chroma samples with QTree recursive structure |
---|
1394 | */ |
---|
1395 | |
---|
1396 | Void |
---|
1397 | TDecCu::xIntraRecQT(TComYuv* pcRecoYuv, |
---|
1398 | TComYuv* pcPredYuv, |
---|
1399 | TComYuv* pcResiYuv, |
---|
1400 | const ChannelType chType, |
---|
1401 | TComTU &rTu) |
---|
1402 | { |
---|
1403 | UInt uiTrDepth = rTu.GetTransformDepthRel(); |
---|
1404 | TComDataCU *pcCU = rTu.getCU(); |
---|
1405 | UInt uiAbsPartIdx = rTu.GetAbsPartIdxTU(); |
---|
1406 | UInt uiTrMode = pcCU->getTransformIdx( uiAbsPartIdx ); |
---|
1407 | if( uiTrMode == uiTrDepth ) |
---|
1408 | { |
---|
1409 | if (isLuma(chType)) |
---|
1410 | { |
---|
1411 | xIntraRecBlk( pcRecoYuv, pcPredYuv, pcResiYuv, COMPONENT_Y, rTu ); |
---|
1412 | } |
---|
1413 | else |
---|
1414 | { |
---|
1415 | const UInt numValidComp=getNumberValidComponents(rTu.GetChromaFormat()); |
---|
1416 | for(UInt compID=COMPONENT_Cb; compID<numValidComp; compID++) |
---|
1417 | { |
---|
1418 | xIntraRecBlk( pcRecoYuv, pcPredYuv, pcResiYuv, ComponentID(compID), rTu ); |
---|
1419 | } |
---|
1420 | } |
---|
1421 | } |
---|
1422 | else |
---|
1423 | { |
---|
1424 | TComTURecurse tuRecurseChild(rTu, false); |
---|
1425 | do |
---|
1426 | { |
---|
1427 | xIntraRecQT( pcRecoYuv, pcPredYuv, pcResiYuv, chType, tuRecurseChild ); |
---|
1428 | } while (tuRecurseChild.nextSection(rTu)); |
---|
1429 | } |
---|
1430 | } |
---|
1431 | |
---|
1432 | Void TDecCu::xCopyToPic( TComDataCU* pcCU, TComPic* pcPic, UInt uiZorderIdx, UInt uiDepth ) |
---|
1433 | { |
---|
1434 | UInt uiCtuRsAddr = pcCU->getCtuRsAddr(); |
---|
1435 | |
---|
1436 | m_ppcYuvReco[uiDepth]->copyToPicYuv ( pcPic->getPicYuvRec (), uiCtuRsAddr, uiZorderIdx ); |
---|
1437 | |
---|
1438 | return; |
---|
1439 | } |
---|
1440 | |
---|
1441 | Void TDecCu::xDecodeInterTexture ( TComDataCU* pcCU, UInt uiDepth ) |
---|
1442 | { |
---|
1443 | |
---|
1444 | TComTURecurse tuRecur(pcCU, 0, uiDepth); |
---|
1445 | |
---|
1446 | for(UInt ch=0; ch<pcCU->getPic()->getNumberValidComponents(); ch++) |
---|
1447 | { |
---|
1448 | const ComponentID compID=ComponentID(ch); |
---|
1449 | DEBUG_STRING_OUTPUT(std::cout, debug_reorder_data_inter_token[compID]) |
---|
1450 | |
---|
1451 | m_pcTrQuant->invRecurTransformNxN ( compID, m_ppcYuvResi[uiDepth], tuRecur ); |
---|
1452 | } |
---|
1453 | |
---|
1454 | DEBUG_STRING_OUTPUT(std::cout, debug_reorder_data_inter_token[MAX_NUM_COMPONENT]) |
---|
1455 | } |
---|
1456 | |
---|
1457 | /** Function for deriving reconstructed luma/chroma samples of a PCM mode CU. |
---|
1458 | * \param pcCU pointer to current CU |
---|
1459 | * \param uiPartIdx part index |
---|
1460 | * \param piPCM pointer to PCM code arrays |
---|
1461 | * \param piReco pointer to reconstructed sample arrays |
---|
1462 | * \param uiStride stride of reconstructed sample arrays |
---|
1463 | * \param uiWidth CU width |
---|
1464 | * \param uiHeight CU height |
---|
1465 | * \param compID colour component ID |
---|
1466 | * \returns Void |
---|
1467 | */ |
---|
1468 | Void TDecCu::xDecodePCMTexture( TComDataCU* pcCU, const UInt uiPartIdx, const Pel *piPCM, Pel* piReco, const UInt uiStride, const UInt uiWidth, const UInt uiHeight, const ComponentID compID) |
---|
1469 | { |
---|
1470 | Pel* piPicReco = pcCU->getPic()->getPicYuvRec()->getAddr(compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu()+uiPartIdx); |
---|
1471 | const UInt uiPicStride = pcCU->getPic()->getPicYuvRec()->getStride(compID); |
---|
1472 | const TComSPS &sps = *(pcCU->getSlice()->getSPS()); |
---|
1473 | const UInt uiPcmLeftShiftBit = sps.getBitDepth(toChannelType(compID)) - sps.getPCMBitDepth(toChannelType(compID)); |
---|
1474 | |
---|
1475 | for(UInt uiY = 0; uiY < uiHeight; uiY++ ) |
---|
1476 | { |
---|
1477 | for(UInt uiX = 0; uiX < uiWidth; uiX++ ) |
---|
1478 | { |
---|
1479 | piReco[uiX] = (piPCM[uiX] << uiPcmLeftShiftBit); |
---|
1480 | piPicReco[uiX] = piReco[uiX]; |
---|
1481 | } |
---|
1482 | piPCM += uiWidth; |
---|
1483 | piReco += uiStride; |
---|
1484 | piPicReco += uiPicStride; |
---|
1485 | } |
---|
1486 | } |
---|
1487 | |
---|
1488 | /** Function for reconstructing a PCM mode CU. |
---|
1489 | * \param pcCU pointer to current CU |
---|
1490 | * \param uiDepth CU Depth |
---|
1491 | * \returns Void |
---|
1492 | */ |
---|
1493 | Void TDecCu::xReconPCM( TComDataCU* pcCU, UInt uiDepth ) |
---|
1494 | { |
---|
1495 | const UInt maxCuWidth = pcCU->getSlice()->getSPS()->getMaxCUWidth(); |
---|
1496 | const UInt maxCuHeight = pcCU->getSlice()->getSPS()->getMaxCUHeight(); |
---|
1497 | for (UInt ch=0; ch < pcCU->getPic()->getNumberValidComponents(); ch++) |
---|
1498 | { |
---|
1499 | const ComponentID compID = ComponentID(ch); |
---|
1500 | const UInt width = (maxCuWidth >>(uiDepth+m_ppcYuvResi[uiDepth]->getComponentScaleX(compID))); |
---|
1501 | const UInt height = (maxCuHeight>>(uiDepth+m_ppcYuvResi[uiDepth]->getComponentScaleY(compID))); |
---|
1502 | const UInt stride = m_ppcYuvResi[uiDepth]->getStride(compID); |
---|
1503 | Pel * pPCMChannel = pcCU->getPCMSample(compID); |
---|
1504 | Pel * pRecChannel = m_ppcYuvReco[uiDepth]->getAddr(compID); |
---|
1505 | xDecodePCMTexture( pcCU, 0, pPCMChannel, pRecChannel, stride, width, height, compID ); |
---|
1506 | } |
---|
1507 | } |
---|
1508 | |
---|
1509 | /** Function for filling the PCM buffer of a CU using its reconstructed sample array |
---|
1510 | * \param pCU pointer to current CU |
---|
1511 | * \param depth CU Depth |
---|
1512 | */ |
---|
1513 | Void TDecCu::xFillPCMBuffer(TComDataCU* pCU, UInt depth) |
---|
1514 | { |
---|
1515 | const ChromaFormat format = pCU->getPic()->getChromaFormat(); |
---|
1516 | const UInt numValidComp = getNumberValidComponents(format); |
---|
1517 | const UInt maxCuWidth = pCU->getSlice()->getSPS()->getMaxCUWidth(); |
---|
1518 | const UInt maxCuHeight = pCU->getSlice()->getSPS()->getMaxCUHeight(); |
---|
1519 | |
---|
1520 | for (UInt componentIndex = 0; componentIndex < numValidComp; componentIndex++) |
---|
1521 | { |
---|
1522 | const ComponentID component = ComponentID(componentIndex); |
---|
1523 | |
---|
1524 | const UInt width = maxCuWidth >> (depth + getComponentScaleX(component, format)); |
---|
1525 | const UInt height = maxCuHeight >> (depth + getComponentScaleY(component, format)); |
---|
1526 | |
---|
1527 | Pel *source = m_ppcYuvReco[depth]->getAddr(component, 0, width); |
---|
1528 | Pel *destination = pCU->getPCMSample(component); |
---|
1529 | |
---|
1530 | const UInt sourceStride = m_ppcYuvReco[depth]->getStride(component); |
---|
1531 | |
---|
1532 | for (Int line = 0; line < height; line++) |
---|
1533 | { |
---|
1534 | for (Int column = 0; column < width; column++) |
---|
1535 | { |
---|
1536 | destination[column] = source[column]; |
---|
1537 | } |
---|
1538 | |
---|
1539 | source += sourceStride; |
---|
1540 | destination += width; |
---|
1541 | } |
---|
1542 | } |
---|
1543 | } |
---|
1544 | |
---|
1545 | //! \} |
---|