1 | /* The copyright in this software is being made available under the BSD |
---|
2 | * License, included below. This software may be subject to other third party |
---|
3 | * and contributor rights, including patent rights, and no such rights are |
---|
4 | * granted under this license. |
---|
5 | * |
---|
6 | * Copyright (c) 2010-2012, ITU/ISO/IEC |
---|
7 | * All rights reserved. |
---|
8 | * |
---|
9 | * Redistribution and use in source and binary forms, with or without |
---|
10 | * modification, are permitted provided that the following conditions are met: |
---|
11 | * |
---|
12 | * * Redistributions of source code must retain the above copyright notice, |
---|
13 | * this list of conditions and the following disclaimer. |
---|
14 | * * Redistributions in binary form must reproduce the above copyright notice, |
---|
15 | * this list of conditions and the following disclaimer in the documentation |
---|
16 | * and/or other materials provided with the distribution. |
---|
17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
18 | * be used to endorse or promote products derived from this software without |
---|
19 | * specific prior written permission. |
---|
20 | * |
---|
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
---|
25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
---|
31 | * THE POSSIBILITY OF SUCH DAMAGE. |
---|
32 | */ |
---|
33 | |
---|
34 | /** \file TDecEntropy.cpp |
---|
35 | \brief entropy decoder class |
---|
36 | */ |
---|
37 | |
---|
38 | #include "TDecEntropy.h" |
---|
39 | |
---|
40 | //! \ingroup TLibDecoder |
---|
41 | //! \{ |
---|
42 | |
---|
43 | Void TDecEntropy::setEntropyDecoder ( TDecEntropyIf* p ) |
---|
44 | { |
---|
45 | m_pcEntropyDecoderIf = p; |
---|
46 | } |
---|
47 | |
---|
48 | #include "TLibCommon/TComAdaptiveLoopFilter.h" |
---|
49 | #include "TLibCommon/TComSampleAdaptiveOffset.h" |
---|
50 | |
---|
51 | Void TDecEntropy::decodeSkipFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
52 | { |
---|
53 | m_pcEntropyDecoderIf->parseSkipFlag( pcCU, uiAbsPartIdx, uiDepth ); |
---|
54 | } |
---|
55 | |
---|
56 | /** decode merge flag |
---|
57 | * \param pcSubCU |
---|
58 | * \param uiAbsPartIdx |
---|
59 | * \param uiDepth |
---|
60 | * \param uiPUIdx |
---|
61 | * \returns Void |
---|
62 | */ |
---|
63 | Void TDecEntropy::decodeMergeFlag( TComDataCU* pcSubCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ) |
---|
64 | { |
---|
65 | // at least one merge candidate exists |
---|
66 | m_pcEntropyDecoderIf->parseMergeFlag( pcSubCU, uiAbsPartIdx, uiDepth, uiPUIdx ); |
---|
67 | } |
---|
68 | |
---|
69 | #if LGE_ILLUCOMP_B0045 |
---|
70 | Void TDecEntropy::decodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
71 | { |
---|
72 | pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth ); |
---|
73 | |
---|
74 | if (pcCU->isIntra(uiAbsPartIdx) || (pcCU->getSlice()->getViewId() == 0) || pcCU->getSlice()->getSPS()->isDepth()) |
---|
75 | { |
---|
76 | return; |
---|
77 | } |
---|
78 | |
---|
79 | if(!pcCU->getSlice()->getApplyIC()) |
---|
80 | return; |
---|
81 | |
---|
82 | if(pcCU->isICFlagRequired(uiAbsPartIdx)) |
---|
83 | m_pcEntropyDecoderIf->parseICFlag( pcCU, uiAbsPartIdx, uiDepth ); |
---|
84 | } |
---|
85 | #endif |
---|
86 | /** decode merge index |
---|
87 | * \param pcCU |
---|
88 | * \param uiPartIdx |
---|
89 | * \param uiAbsPartIdx |
---|
90 | * \param puhInterDirNeighbours pointer to list of inter direction from the casual neighbours |
---|
91 | * \param pcMvFieldNeighbours pointer to list of motion vector field from the casual neighbours |
---|
92 | * \param uiDepth |
---|
93 | * \returns Void |
---|
94 | */ |
---|
95 | Void TDecEntropy::decodeMergeIndex( TComDataCU* pcCU, UInt uiPartIdx, UInt uiAbsPartIdx, PartSize eCUMode, UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, UInt uiDepth ) |
---|
96 | { |
---|
97 | UInt uiMergeIndex = 0; |
---|
98 | m_pcEntropyDecoderIf->parseMergeIndex( pcCU, uiMergeIndex, uiAbsPartIdx, uiDepth ); |
---|
99 | pcCU->setMergeIndexSubParts( uiMergeIndex, uiAbsPartIdx, uiPartIdx, uiDepth ); |
---|
100 | } |
---|
101 | |
---|
102 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
103 | Void |
---|
104 | TDecEntropy::decodeResPredFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU, UInt uiPUIdx ) |
---|
105 | { |
---|
106 | Bool bResPredAvailable = false; |
---|
107 | Bool bResPredFlag = false; |
---|
108 | |
---|
109 | Bool bResPredAllowed = (!pcCU->getSlice()->getSPS()->isDepth () ); |
---|
110 | bResPredAllowed = bResPredAllowed && ( pcCU->getSlice()->getSPS()->getViewId () ); |
---|
111 | bResPredAllowed = bResPredAllowed && ( pcCU->getSlice()->getSPS()->getMultiviewResPredMode() ); |
---|
112 | bResPredAllowed = bResPredAllowed && (!pcCU->isIntra ( uiAbsPartIdx ) ); |
---|
113 | |
---|
114 | // check if supported |
---|
115 | if( bResPredAllowed ) |
---|
116 | { |
---|
117 | bResPredAvailable = pcSubCU->getResidualSamples( uiPUIdx |
---|
118 | #if QC_SIMPLIFIEDIVRP_M24938 |
---|
119 | , false |
---|
120 | #endif |
---|
121 | ); |
---|
122 | } |
---|
123 | |
---|
124 | // read from bitstream |
---|
125 | if( bResPredAvailable ) |
---|
126 | { |
---|
127 | #if LG_RESTRICTEDRESPRED_M24766 |
---|
128 | Int iPUResiPredShift[4]; |
---|
129 | pcCU->getPUResiPredShift(iPUResiPredShift, uiAbsPartIdx); |
---|
130 | if(iPUResiPredShift[0] >= 0 || iPUResiPredShift[1] >= 0 || iPUResiPredShift[2] >= 0 || iPUResiPredShift[3] >= 0 ) |
---|
131 | #endif |
---|
132 | m_pcEntropyDecoderIf->parseResPredFlag( pcCU, bResPredFlag, uiAbsPartIdx, uiDepth ); |
---|
133 | } |
---|
134 | |
---|
135 | // set data |
---|
136 | pcCU->setResPredAvailSubParts ( bResPredAvailable, uiAbsPartIdx, uiPUIdx, uiDepth ); |
---|
137 | pcCU->setResPredFlagSubParts ( bResPredFlag, uiAbsPartIdx, uiPUIdx, uiDepth ); |
---|
138 | } |
---|
139 | #endif |
---|
140 | |
---|
141 | Void TDecEntropy::decodeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
142 | { |
---|
143 | m_pcEntropyDecoderIf->parseSplitFlag( pcCU, uiAbsPartIdx, uiDepth ); |
---|
144 | } |
---|
145 | |
---|
146 | Void TDecEntropy::decodePredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
147 | { |
---|
148 | m_pcEntropyDecoderIf->parsePredMode( pcCU, uiAbsPartIdx, uiDepth ); |
---|
149 | |
---|
150 | #if RWTH_SDC_DLT_B0036 |
---|
151 | // if B-Slice, code SDC flag later |
---|
152 | if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSlice()->getSPS()->isDepth() ) |
---|
153 | { |
---|
154 | // decode SDC flag |
---|
155 | decodeSDCFlag(pcCU, uiAbsPartIdx, uiDepth); |
---|
156 | } |
---|
157 | #endif |
---|
158 | } |
---|
159 | |
---|
160 | Void TDecEntropy::decodePartSize( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
161 | { |
---|
162 | #if RWTH_SDC_DLT_B0036 |
---|
163 | if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSDCFlag(uiAbsPartIdx) ) |
---|
164 | { |
---|
165 | pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); |
---|
166 | pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth ); |
---|
167 | return; |
---|
168 | } |
---|
169 | #endif |
---|
170 | |
---|
171 | m_pcEntropyDecoderIf->parsePartSize( pcCU, uiAbsPartIdx, uiDepth ); |
---|
172 | |
---|
173 | #if RWTH_SDC_DLT_B0036 |
---|
174 | if( pcCU->getSlice()->isInterB() && pcCU->getSlice()->getSPS()->isDepth() && pcCU->isIntra(uiAbsPartIdx) ) |
---|
175 | { |
---|
176 | // decode SDC flag |
---|
177 | decodeSDCFlag(pcCU, uiAbsPartIdx, uiDepth); |
---|
178 | |
---|
179 | if( pcCU->getSDCFlag(uiAbsPartIdx) ) |
---|
180 | { |
---|
181 | // part size is also known for SDC intra |
---|
182 | pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); |
---|
183 | pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth ); |
---|
184 | } |
---|
185 | } |
---|
186 | #endif |
---|
187 | } |
---|
188 | |
---|
189 | Void TDecEntropy::decodePredInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU ) |
---|
190 | { |
---|
191 | #if RWTH_SDC_DLT_B0036 |
---|
192 | if( pcCU->getSDCFlag(uiAbsPartIdx) ) |
---|
193 | { |
---|
194 | decodeSDCPredMode(pcCU, uiAbsPartIdx, uiDepth); |
---|
195 | return; |
---|
196 | } |
---|
197 | #endif |
---|
198 | |
---|
199 | PartSize eMode = pcCU->getPartitionSize( uiAbsPartIdx ); |
---|
200 | |
---|
201 | if( pcCU->isIntra( uiAbsPartIdx ) ) // If it is Intra mode, encode intra prediction mode. |
---|
202 | { |
---|
203 | if( eMode == SIZE_NxN ) // if it is NxN size, encode 4 intra directions. |
---|
204 | { |
---|
205 | UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth(uiAbsPartIdx) << 1 ) ) >> 2; |
---|
206 | // if it is NxN size, this size might be the smallest partition size. // if it is NxN size, this size might be the smallest partition size. |
---|
207 | decodeIntraDirModeLuma( pcCU, uiAbsPartIdx, uiDepth+1 ); |
---|
208 | decodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset, uiDepth+1 ); |
---|
209 | decodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*2, uiDepth+1 ); |
---|
210 | decodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*3, uiDepth+1 ); |
---|
211 | decodeIntraDirModeChroma( pcCU, uiAbsPartIdx, uiDepth ); |
---|
212 | } |
---|
213 | else // if it is not NxN size, encode 1 intra directions |
---|
214 | { |
---|
215 | decodeIntraDirModeLuma ( pcCU, uiAbsPartIdx, uiDepth ); |
---|
216 | decodeIntraDirModeChroma( pcCU, uiAbsPartIdx, uiDepth ); |
---|
217 | } |
---|
218 | } |
---|
219 | else // if it is Inter mode, encode motion vector and reference index |
---|
220 | { |
---|
221 | decodePUWise( pcCU, uiAbsPartIdx, uiDepth, pcSubCU ); |
---|
222 | } |
---|
223 | } |
---|
224 | |
---|
225 | /** Parse I_PCM information. |
---|
226 | * \param pcCU pointer to CUpointer to CU |
---|
227 | * \param uiAbsPartIdx CU index |
---|
228 | * \param uiDepth CU depth |
---|
229 | * \returns Void |
---|
230 | */ |
---|
231 | Void TDecEntropy::decodeIPCMInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
232 | { |
---|
233 | if(!pcCU->getSlice()->getSPS()->getUsePCM() |
---|
234 | || pcCU->getWidth(uiAbsPartIdx) > (1<<pcCU->getSlice()->getSPS()->getPCMLog2MaxSize()) |
---|
235 | || pcCU->getWidth(uiAbsPartIdx) < (1<<pcCU->getSlice()->getSPS()->getPCMLog2MinSize()) ) |
---|
236 | { |
---|
237 | return; |
---|
238 | } |
---|
239 | |
---|
240 | #if RWTH_SDC_DLT_B0036 |
---|
241 | if( pcCU->getSDCFlag(uiAbsPartIdx) ) |
---|
242 | { |
---|
243 | return; |
---|
244 | } |
---|
245 | #endif |
---|
246 | |
---|
247 | m_pcEntropyDecoderIf->parseIPCMInfo( pcCU, uiAbsPartIdx, uiDepth ); |
---|
248 | } |
---|
249 | |
---|
250 | Void TDecEntropy::decodeIntraDirModeLuma ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
251 | { |
---|
252 | m_pcEntropyDecoderIf->parseIntraDirLumaAng( pcCU, uiAbsPartIdx, uiDepth ); |
---|
253 | } |
---|
254 | |
---|
255 | Void TDecEntropy::decodeIntraDirModeChroma( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
256 | { |
---|
257 | m_pcEntropyDecoderIf->parseIntraDirChroma( pcCU, uiAbsPartIdx, uiDepth ); |
---|
258 | } |
---|
259 | |
---|
260 | /** decode motion information for every PU block. |
---|
261 | * \param pcCU |
---|
262 | * \param uiAbsPartIdx |
---|
263 | * \param uiDepth |
---|
264 | * \param pcSubCU |
---|
265 | * \returns Void |
---|
266 | */ |
---|
267 | Void TDecEntropy::decodePUWise( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU ) |
---|
268 | { |
---|
269 | PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx ); |
---|
270 | UInt uiNumPU = ( ePartSize == SIZE_2Nx2N ? 1 : ( ePartSize == SIZE_NxN ? 4 : 2 ) ); |
---|
271 | UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxCUDepth() - uiDepth ) << 1 ) ) >> 4; |
---|
272 | |
---|
273 | #if CU_BASED_MRG_CAND_LIST |
---|
274 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
275 | TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists |
---|
276 | UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; |
---|
277 | for ( UInt ui = 0; ui < MRG_MAX_NUM_CANDS_MEM; ui++ ) |
---|
278 | #else |
---|
279 | TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists |
---|
280 | UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS]; |
---|
281 | for ( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ui++ ) |
---|
282 | #endif |
---|
283 | { |
---|
284 | uhInterDirNeighbours[ui] = 0; |
---|
285 | } |
---|
286 | Int numValidMergeCand = 0; |
---|
287 | bool isMerged = false; |
---|
288 | #endif |
---|
289 | |
---|
290 | pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 ); |
---|
291 | pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 ); |
---|
292 | for ( UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset ) |
---|
293 | { |
---|
294 | #if !CU_BASED_MRG_CAND_LIST |
---|
295 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
296 | TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists |
---|
297 | UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; |
---|
298 | Int numValidMergeCand = 0; |
---|
299 | for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS_MEM; ++ui ) |
---|
300 | #else |
---|
301 | TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists |
---|
302 | UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS]; |
---|
303 | Int numValidMergeCand = 0; |
---|
304 | for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ++ui ) |
---|
305 | #endif |
---|
306 | { |
---|
307 | uhInterDirNeighbours[ui] = 0; |
---|
308 | } |
---|
309 | #endif |
---|
310 | decodeMergeFlag( pcCU, uiSubPartIdx, uiDepth, uiPartIdx ); |
---|
311 | if ( pcCU->getMergeFlag( uiSubPartIdx ) ) |
---|
312 | { |
---|
313 | decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, ePartSize, uhInterDirNeighbours, cMvFieldNeighbours, uiDepth ); |
---|
314 | #if CU_BASED_MRG_CAND_LIST |
---|
315 | UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); |
---|
316 | if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 ) |
---|
317 | { |
---|
318 | pcSubCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); |
---|
319 | if ( !isMerged ) |
---|
320 | { |
---|
321 | pcSubCU->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); |
---|
322 | isMerged = true; |
---|
323 | } |
---|
324 | pcSubCU->setPartSizeSubParts( ePartSize, 0, uiDepth ); |
---|
325 | } |
---|
326 | else |
---|
327 | { |
---|
328 | #if SIMP_MRG_PRUN |
---|
329 | uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); |
---|
330 | pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); |
---|
331 | #else |
---|
332 | pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); |
---|
333 | uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); |
---|
334 | #endif |
---|
335 | } |
---|
336 | #else |
---|
337 | #if SIMP_MRG_PRUN |
---|
338 | UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); |
---|
339 | pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); |
---|
340 | #else |
---|
341 | pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); |
---|
342 | UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); |
---|
343 | #endif |
---|
344 | #endif |
---|
345 | pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); |
---|
346 | |
---|
347 | TComMv cTmpMv( 0, 0 ); |
---|
348 | for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) |
---|
349 | { |
---|
350 | if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 ) |
---|
351 | { |
---|
352 | pcCU->setMVPIdxSubParts( 0, RefPicList( uiRefListIdx ), uiSubPartIdx, uiPartIdx, uiDepth); |
---|
353 | pcCU->setMVPNumSubParts( 0, RefPicList( uiRefListIdx ), uiSubPartIdx, uiPartIdx, uiDepth); |
---|
354 | pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); |
---|
355 | pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); |
---|
356 | |
---|
357 | } |
---|
358 | } |
---|
359 | } |
---|
360 | else |
---|
361 | { |
---|
362 | decodeInterDirPU( pcCU, uiSubPartIdx, uiDepth, uiPartIdx ); |
---|
363 | for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) |
---|
364 | { |
---|
365 | if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 ) |
---|
366 | { |
---|
367 | decodeRefFrmIdxPU( pcCU, uiSubPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); |
---|
368 | decodeMvdPU ( pcCU, uiSubPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); |
---|
369 | decodeMVPIdxPU ( pcSubCU, uiSubPartIdx-uiAbsPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); |
---|
370 | } |
---|
371 | } |
---|
372 | } |
---|
373 | } |
---|
374 | return; |
---|
375 | } |
---|
376 | |
---|
377 | /** decode inter direction for a PU block |
---|
378 | * \param pcCU |
---|
379 | * \param uiAbsPartIdx |
---|
380 | * \param uiDepth |
---|
381 | * \param uiPartIdx |
---|
382 | * \returns Void |
---|
383 | */ |
---|
384 | Void TDecEntropy::decodeInterDirPU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx ) |
---|
385 | { |
---|
386 | UInt uiInterDir; |
---|
387 | |
---|
388 | if ( pcCU->getSlice()->isInterP() ) |
---|
389 | { |
---|
390 | uiInterDir = 1; |
---|
391 | } |
---|
392 | else |
---|
393 | { |
---|
394 | m_pcEntropyDecoderIf->parseInterDir( pcCU, uiInterDir, uiAbsPartIdx, uiDepth ); |
---|
395 | } |
---|
396 | |
---|
397 | pcCU->setInterDirSubParts( uiInterDir, uiAbsPartIdx, uiPartIdx, uiDepth ); |
---|
398 | } |
---|
399 | |
---|
400 | Void TDecEntropy::decodeRefFrmIdxPU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList ) |
---|
401 | { |
---|
402 | if(pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && pcCU->getInterDir( uiAbsPartIdx ) != 3) |
---|
403 | { |
---|
404 | if(eRefList == REF_PIC_LIST_1) |
---|
405 | { |
---|
406 | return; |
---|
407 | } |
---|
408 | |
---|
409 | Int iRefFrmIdx = 0; |
---|
410 | Int iRefFrmIdxTemp; |
---|
411 | UInt uiInterDir; |
---|
412 | RefPicList eRefListTemp; |
---|
413 | |
---|
414 | PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx ); |
---|
415 | |
---|
416 | if ( pcCU->getSlice()->getNumRefIdx ( REF_PIC_LIST_C ) > 1 ) |
---|
417 | { |
---|
418 | m_pcEntropyDecoderIf->parseRefFrmIdx( pcCU, iRefFrmIdx, uiAbsPartIdx, uiDepth, REF_PIC_LIST_C ); |
---|
419 | } |
---|
420 | else |
---|
421 | { |
---|
422 | iRefFrmIdx=0; |
---|
423 | } |
---|
424 | uiInterDir = pcCU->getSlice()->getListIdFromIdxOfLC(iRefFrmIdx) + 1; |
---|
425 | iRefFrmIdxTemp = pcCU->getSlice()->getRefIdxFromIdxOfLC(iRefFrmIdx); |
---|
426 | eRefListTemp = (RefPicList)pcCU->getSlice()->getListIdFromIdxOfLC(iRefFrmIdx); |
---|
427 | |
---|
428 | pcCU->getCUMvField( eRefListTemp )->setAllRefIdx( iRefFrmIdxTemp, ePartSize, uiAbsPartIdx, uiDepth, uiPartIdx ); |
---|
429 | |
---|
430 | pcCU->setInterDirSubParts( uiInterDir, uiAbsPartIdx, uiPartIdx, uiDepth ); |
---|
431 | } |
---|
432 | else |
---|
433 | { |
---|
434 | Int iRefFrmIdx = 0; |
---|
435 | Int iParseRefFrmIdx = pcCU->getInterDir( uiAbsPartIdx ) & ( 1 << eRefList ); |
---|
436 | |
---|
437 | if ( pcCU->getSlice()->getNumRefIdx( eRefList ) > 1 && iParseRefFrmIdx ) |
---|
438 | { |
---|
439 | m_pcEntropyDecoderIf->parseRefFrmIdx( pcCU, iRefFrmIdx, uiAbsPartIdx, uiDepth, eRefList ); |
---|
440 | } |
---|
441 | else if ( !iParseRefFrmIdx ) |
---|
442 | { |
---|
443 | iRefFrmIdx = NOT_VALID; |
---|
444 | } |
---|
445 | else |
---|
446 | { |
---|
447 | iRefFrmIdx = 0; |
---|
448 | } |
---|
449 | |
---|
450 | PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx ); |
---|
451 | pcCU->getCUMvField( eRefList )->setAllRefIdx( iRefFrmIdx, ePartSize, uiAbsPartIdx, uiDepth, uiPartIdx ); |
---|
452 | } |
---|
453 | } |
---|
454 | |
---|
455 | /** decode motion vector difference for a PU block |
---|
456 | * \param pcCU |
---|
457 | * \param uiAbsPartIdx |
---|
458 | * \param uiDepth |
---|
459 | * \param uiPartIdx |
---|
460 | * \param eRefList |
---|
461 | * \returns Void |
---|
462 | */ |
---|
463 | Void TDecEntropy::decodeMvdPU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList ) |
---|
464 | { |
---|
465 | if ( pcCU->getInterDir( uiAbsPartIdx ) & ( 1 << eRefList ) ) |
---|
466 | { |
---|
467 | m_pcEntropyDecoderIf->parseMvd( pcCU, uiAbsPartIdx, uiPartIdx, uiDepth, eRefList ); |
---|
468 | } |
---|
469 | } |
---|
470 | |
---|
471 | Void TDecEntropy::decodeMVPIdxPU( TComDataCU* pcSubCU, UInt uiPartAddr, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList ) |
---|
472 | { |
---|
473 | Int iMVPIdx = -1; |
---|
474 | |
---|
475 | TComMv cZeroMv( 0, 0 ); |
---|
476 | TComMv cMv = cZeroMv; |
---|
477 | Int iRefIdx = -1; |
---|
478 | |
---|
479 | TComCUMvField* pcSubCUMvField = pcSubCU->getCUMvField( eRefList ); |
---|
480 | AMVPInfo* pAMVPInfo = pcSubCUMvField->getAMVPInfo(); |
---|
481 | |
---|
482 | iRefIdx = pcSubCUMvField->getRefIdx(uiPartAddr); |
---|
483 | cMv = cZeroMv; |
---|
484 | |
---|
485 | if ( (pcSubCU->getInterDir(uiPartAddr) & ( 1 << eRefList )) && (pcSubCU->getAMVPMode(uiPartAddr) == AM_EXPL) ) |
---|
486 | { |
---|
487 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
488 | const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcSubCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 ); |
---|
489 | m_pcEntropyDecoderIf->parseMVPIdx( iMVPIdx, iNumAMVPCands ); |
---|
490 | #else |
---|
491 | m_pcEntropyDecoderIf->parseMVPIdx( iMVPIdx ); |
---|
492 | #endif |
---|
493 | } |
---|
494 | pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo); |
---|
495 | pcSubCU->setMVPNumSubParts(pAMVPInfo->iN, eRefList, uiPartAddr, uiPartIdx, uiDepth); |
---|
496 | pcSubCU->setMVPIdxSubParts( iMVPIdx, eRefList, uiPartAddr, uiPartIdx, uiDepth ); |
---|
497 | if ( iRefIdx >= 0 ) |
---|
498 | { |
---|
499 | m_pcPrediction->getMvPredAMVP( pcSubCU, uiPartIdx, uiPartAddr, eRefList, iRefIdx, cMv); |
---|
500 | cMv += pcSubCUMvField->getMvd( uiPartAddr ); |
---|
501 | } |
---|
502 | |
---|
503 | PartSize ePartSize = pcSubCU->getPartitionSize( uiPartAddr ); |
---|
504 | pcSubCU->getCUMvField( eRefList )->setAllMv(cMv, ePartSize, uiPartAddr, 0, uiPartIdx); |
---|
505 | } |
---|
506 | |
---|
507 | #if UNIFIED_TRANSFORM_TREE |
---|
508 | Void TDecEntropy::xDecodeTransform( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, UInt uiInnerQuadIdx, UInt& uiYCbfFront3, UInt& uiUCbfFront3, UInt& uiVCbfFront3, Bool& bCodeDQP ) |
---|
509 | #else |
---|
510 | Void TDecEntropy::xDecodeTransformSubdiv( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt uiInnerQuadIdx, UInt& uiYCbfFront3, UInt& uiUCbfFront3, UInt& uiVCbfFront3 ) |
---|
511 | #endif |
---|
512 | { |
---|
513 | UInt uiSubdiv; |
---|
514 | const UInt uiLog2TrafoSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()]+2 - uiDepth; |
---|
515 | |
---|
516 | #if UNIFIED_TRANSFORM_TREE |
---|
517 | if(uiTrIdx==0) |
---|
518 | { |
---|
519 | m_bakAbsPartIdxCU = uiAbsPartIdx; |
---|
520 | } |
---|
521 | if( uiLog2TrafoSize == 2 ) |
---|
522 | { |
---|
523 | UInt partNum = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 ); |
---|
524 | if( ( uiAbsPartIdx % partNum ) == 0 ) |
---|
525 | { |
---|
526 | m_uiBakAbsPartIdx = uiAbsPartIdx; |
---|
527 | m_uiBakChromaOffset = offsetChroma; |
---|
528 | } |
---|
529 | } |
---|
530 | #endif // UNIFIED_TRANSFORM_TREE |
---|
531 | if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTRA && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_NxN && uiDepth == pcCU->getDepth(uiAbsPartIdx) ) |
---|
532 | { |
---|
533 | uiSubdiv = 1; |
---|
534 | } |
---|
535 | #if G519_TU_AMP_NSQT_HARMONIZATION |
---|
536 | else if( (pcCU->getSlice()->getSPS()->getQuadtreeTUMaxDepthInter() == 1) && (pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER) && ( pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N ) && (uiDepth == pcCU->getDepth(uiAbsPartIdx)) ) |
---|
537 | #else |
---|
538 | else if( (pcCU->getSlice()->getSPS()->getQuadtreeTUMaxDepthInter() == 1) && (pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER) && ( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && (uiDepth == pcCU->getDepth(uiAbsPartIdx)) ) |
---|
539 | #endif |
---|
540 | { |
---|
541 | uiSubdiv = (uiLog2TrafoSize > pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx)); |
---|
542 | } |
---|
543 | else if( uiLog2TrafoSize > pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) |
---|
544 | { |
---|
545 | uiSubdiv = 1; |
---|
546 | } |
---|
547 | else if( uiLog2TrafoSize == pcCU->getSlice()->getSPS()->getQuadtreeTULog2MinSize() ) |
---|
548 | { |
---|
549 | uiSubdiv = 0; |
---|
550 | } |
---|
551 | else if( uiLog2TrafoSize == pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx) ) |
---|
552 | { |
---|
553 | uiSubdiv = 0; |
---|
554 | } |
---|
555 | else |
---|
556 | { |
---|
557 | assert( uiLog2TrafoSize > pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx) ); |
---|
558 | m_pcEntropyDecoderIf->parseTransformSubdivFlag( uiSubdiv, uiDepth ); |
---|
559 | } |
---|
560 | |
---|
561 | const UInt uiTrDepth = uiDepth - pcCU->getDepth( uiAbsPartIdx ); |
---|
562 | |
---|
563 | if( uiLog2TrafoSize <= pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) |
---|
564 | { |
---|
565 | const Bool bFirstCbfOfCU = uiLog2TrafoSize == pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() || uiTrDepth == 0; |
---|
566 | if( bFirstCbfOfCU ) |
---|
567 | { |
---|
568 | pcCU->setCbfSubParts( 0, TEXT_CHROMA_U, uiAbsPartIdx, uiDepth ); |
---|
569 | pcCU->setCbfSubParts( 0, TEXT_CHROMA_V, uiAbsPartIdx, uiDepth ); |
---|
570 | } |
---|
571 | if( bFirstCbfOfCU || uiLog2TrafoSize > 2 ) |
---|
572 | { |
---|
573 | if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) ) |
---|
574 | { |
---|
575 | if ( uiInnerQuadIdx == 3 && uiUCbfFront3 == 0 && uiLog2TrafoSize < pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) |
---|
576 | { |
---|
577 | uiUCbfFront3++; |
---|
578 | pcCU->setCbfSubParts( 1 << uiTrDepth, TEXT_CHROMA_U, uiAbsPartIdx, uiDepth ); |
---|
579 | //printf( " \nsave bits, U Cbf"); |
---|
580 | } |
---|
581 | else |
---|
582 | { |
---|
583 | m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth, uiDepth ); |
---|
584 | uiUCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth ); |
---|
585 | } |
---|
586 | } |
---|
587 | if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth - 1 ) ) |
---|
588 | { |
---|
589 | if ( uiInnerQuadIdx == 3 && uiVCbfFront3 == 0 && uiLog2TrafoSize < pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) |
---|
590 | { |
---|
591 | uiVCbfFront3++; |
---|
592 | pcCU->setCbfSubParts( 1 << uiTrDepth, TEXT_CHROMA_V, uiAbsPartIdx, uiDepth ); |
---|
593 | //printf( " \nsave bits, V Cbf"); |
---|
594 | } |
---|
595 | else |
---|
596 | { |
---|
597 | m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth, uiDepth ); |
---|
598 | uiVCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth ); |
---|
599 | } |
---|
600 | } |
---|
601 | } |
---|
602 | else |
---|
603 | { |
---|
604 | pcCU->setCbfSubParts( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) << uiTrDepth, TEXT_CHROMA_U, uiAbsPartIdx, uiDepth ); |
---|
605 | pcCU->setCbfSubParts( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth - 1 ) << uiTrDepth, TEXT_CHROMA_V, uiAbsPartIdx, uiDepth ); |
---|
606 | if ( uiLog2TrafoSize == 2 ) |
---|
607 | { |
---|
608 | uiUCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth ); |
---|
609 | uiVCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth ); |
---|
610 | } |
---|
611 | } |
---|
612 | } |
---|
613 | |
---|
614 | if( uiSubdiv ) |
---|
615 | { |
---|
616 | #if UNIFIED_TRANSFORM_TREE |
---|
617 | UInt size; |
---|
618 | width >>= 1; |
---|
619 | height >>= 1; |
---|
620 | size = width*height; |
---|
621 | uiTrIdx++; |
---|
622 | #endif |
---|
623 | ++uiDepth; |
---|
624 | const UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); |
---|
625 | const UInt uiStartAbsPartIdx = uiAbsPartIdx; |
---|
626 | UInt uiLumaTrMode, uiChromaTrMode; |
---|
627 | pcCU->convertTransIdx( uiStartAbsPartIdx, uiTrDepth+1, uiLumaTrMode, uiChromaTrMode ); |
---|
628 | UInt uiYCbf = 0; |
---|
629 | UInt uiUCbf = 0; |
---|
630 | UInt uiVCbf = 0; |
---|
631 | |
---|
632 | UInt uiCurrentCbfY = 0; |
---|
633 | UInt uiCurrentCbfU = 0; |
---|
634 | UInt uiCurrentCbfV = 0; |
---|
635 | |
---|
636 | for( Int i = 0; i < 4; i++ ) |
---|
637 | { |
---|
638 | #if UNIFIED_TRANSFORM_TREE |
---|
639 | UInt nsAddr = 0; |
---|
640 | nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, i, uiTrDepth+1 ); |
---|
641 | xDecodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, nsAddr, uiDepth, width, height, uiTrIdx, i, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV, bCodeDQP ); |
---|
642 | #else |
---|
643 | UInt nsAddr = 0; |
---|
644 | nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, i, uiTrDepth+1 ); |
---|
645 | xDecodeTransformSubdiv( pcCU, uiAbsPartIdx, nsAddr, uiDepth, i, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV ); |
---|
646 | #endif |
---|
647 | uiYCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode ); |
---|
648 | uiUCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiChromaTrMode ); |
---|
649 | uiVCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiChromaTrMode ); |
---|
650 | uiAbsPartIdx += uiQPartNum; |
---|
651 | #if UNIFIED_TRANSFORM_TREE |
---|
652 | offsetLuma += size; offsetChroma += (size>>2); |
---|
653 | #endif |
---|
654 | } |
---|
655 | |
---|
656 | uiYCbfFront3 += uiCurrentCbfY; |
---|
657 | uiUCbfFront3 += uiCurrentCbfU; |
---|
658 | uiVCbfFront3 += uiCurrentCbfV; |
---|
659 | |
---|
660 | pcCU->convertTransIdx( uiStartAbsPartIdx, uiTrDepth, uiLumaTrMode, uiChromaTrMode ); |
---|
661 | for( UInt ui = 0; ui < 4 * uiQPartNum; ++ui ) |
---|
662 | { |
---|
663 | pcCU->getCbf( TEXT_LUMA )[uiStartAbsPartIdx + ui] |= uiYCbf << uiLumaTrMode; |
---|
664 | pcCU->getCbf( TEXT_CHROMA_U )[uiStartAbsPartIdx + ui] |= uiUCbf << uiChromaTrMode; |
---|
665 | pcCU->getCbf( TEXT_CHROMA_V )[uiStartAbsPartIdx + ui] |= uiVCbf << uiChromaTrMode; |
---|
666 | } |
---|
667 | } |
---|
668 | else |
---|
669 | { |
---|
670 | assert( uiDepth >= pcCU->getDepth( uiAbsPartIdx ) ); |
---|
671 | pcCU->setTrIdxSubParts( uiTrDepth, uiAbsPartIdx, uiDepth ); |
---|
672 | |
---|
673 | { |
---|
674 | DTRACE_CABAC_VL( g_nSymbolCounter++ ); |
---|
675 | DTRACE_CABAC_T( "\tTrIdx: abspart=" ); |
---|
676 | DTRACE_CABAC_V( uiAbsPartIdx ); |
---|
677 | DTRACE_CABAC_T( "\tdepth=" ); |
---|
678 | DTRACE_CABAC_V( uiDepth ); |
---|
679 | DTRACE_CABAC_T( "\ttrdepth=" ); |
---|
680 | DTRACE_CABAC_V( uiTrDepth ); |
---|
681 | DTRACE_CABAC_T( "\n" ); |
---|
682 | } |
---|
683 | |
---|
684 | UInt uiLumaTrMode, uiChromaTrMode; |
---|
685 | pcCU->convertTransIdx( uiAbsPartIdx, uiTrDepth, uiLumaTrMode, uiChromaTrMode ); |
---|
686 | if(pcCU->getPredictionMode( uiAbsPartIdx ) == MODE_INTER && pcCU->useNonSquarePU( uiAbsPartIdx ) ) |
---|
687 | { |
---|
688 | pcCU->setNSQTIdxSubParts( uiLog2TrafoSize, uiAbsPartIdx, absTUPartIdx, uiLumaTrMode ); |
---|
689 | } |
---|
690 | pcCU->setCbfSubParts ( 0, TEXT_LUMA, uiAbsPartIdx, uiDepth ); |
---|
691 | if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) ) |
---|
692 | { |
---|
693 | pcCU->setCbfSubParts( 1 << uiLumaTrMode, TEXT_LUMA, uiAbsPartIdx, uiDepth ); |
---|
694 | } |
---|
695 | else |
---|
696 | { |
---|
697 | const UInt uiLog2CUSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()] + 2 - pcCU->getDepth( uiAbsPartIdx ); |
---|
698 | if ( pcCU->getPredictionMode( uiAbsPartIdx ) != MODE_INTRA && uiInnerQuadIdx == 3 && uiYCbfFront3 == 0 && uiUCbfFront3 == 0 && uiVCbfFront3 == 0 |
---|
699 | && ( uiLog2CUSize <= pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() + 1 || uiLog2TrafoSize < pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) ) |
---|
700 | { |
---|
701 | pcCU->setCbfSubParts( 1 << uiLumaTrMode, TEXT_LUMA, uiAbsPartIdx, uiDepth ); |
---|
702 | //printf( " \nsave bits, Y Cbf"); |
---|
703 | uiYCbfFront3++; |
---|
704 | } |
---|
705 | else |
---|
706 | { |
---|
707 | m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode, uiDepth ); |
---|
708 | uiYCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode ); |
---|
709 | } |
---|
710 | } |
---|
711 | #if UNIFIED_TRANSFORM_TREE |
---|
712 | // transform_unit begin |
---|
713 | UInt cbfY = pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA , uiTrIdx ); |
---|
714 | UInt cbfU = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ); |
---|
715 | UInt cbfV = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ); |
---|
716 | if( uiLog2TrafoSize == 2 ) |
---|
717 | { |
---|
718 | UInt partNum = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 ); |
---|
719 | if( ( uiAbsPartIdx % partNum ) == (partNum - 1) ) |
---|
720 | { |
---|
721 | cbfU = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ); |
---|
722 | cbfV = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ); |
---|
723 | } |
---|
724 | } |
---|
725 | if ( cbfY || cbfU || cbfV ) |
---|
726 | { |
---|
727 | // dQP: only for LCU |
---|
728 | if ( pcCU->getSlice()->getPPS()->getUseDQP() ) |
---|
729 | { |
---|
730 | if ( bCodeDQP ) |
---|
731 | { |
---|
732 | decodeQP( pcCU, m_bakAbsPartIdxCU); |
---|
733 | bCodeDQP = false; |
---|
734 | } |
---|
735 | } |
---|
736 | } |
---|
737 | if( cbfY ) |
---|
738 | { |
---|
739 | Int trWidth = width; |
---|
740 | Int trHeight = height; |
---|
741 | pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight ); |
---|
742 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffY()+offsetLuma), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_LUMA ); |
---|
743 | } |
---|
744 | if( uiLog2TrafoSize > 2 ) |
---|
745 | { |
---|
746 | Int trWidth = width >> 1; |
---|
747 | Int trHeight = height >> 1; |
---|
748 | pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight ); |
---|
749 | if( cbfU ) |
---|
750 | { |
---|
751 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCb()+offsetChroma), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U ); |
---|
752 | } |
---|
753 | if( cbfV ) |
---|
754 | { |
---|
755 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCr()+offsetChroma), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V ); |
---|
756 | } |
---|
757 | } |
---|
758 | else |
---|
759 | { |
---|
760 | UInt partNum = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 ); |
---|
761 | if( ( uiAbsPartIdx % partNum ) == (partNum - 1) ) |
---|
762 | { |
---|
763 | Int trWidth = width; |
---|
764 | Int trHeight = height; |
---|
765 | pcCU->getNSQTSize( uiTrIdx - 1, uiAbsPartIdx, trWidth, trHeight ); |
---|
766 | if( cbfU ) |
---|
767 | { |
---|
768 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCb()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U ); |
---|
769 | } |
---|
770 | if( cbfV ) |
---|
771 | { |
---|
772 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCr()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V ); |
---|
773 | } |
---|
774 | } |
---|
775 | } |
---|
776 | // transform_unit end |
---|
777 | #endif // UNIFIED_TRANSFORM_TREE |
---|
778 | } |
---|
779 | } |
---|
780 | |
---|
781 | #if !UNIFIED_TRANSFORM_TREE |
---|
782 | Void TDecEntropy::decodeTransformIdx( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
783 | { |
---|
784 | DTRACE_CABAC_VL( g_nSymbolCounter++ ) |
---|
785 | DTRACE_CABAC_T( "\tdecodeTransformIdx()\tCUDepth=" ) |
---|
786 | DTRACE_CABAC_V( uiDepth ) |
---|
787 | DTRACE_CABAC_T( "\n" ) |
---|
788 | UInt temp = 0; |
---|
789 | UInt temp1 = 0; |
---|
790 | UInt temp2 = 0; |
---|
791 | xDecodeTransformSubdiv( pcCU, uiAbsPartIdx, uiAbsPartIdx, uiDepth, 0, temp, temp1, temp2 ); |
---|
792 | } |
---|
793 | #endif // UNIFIED_TRANSFORM_TREE |
---|
794 | |
---|
795 | #if UNIFIED_TRANSFORM_TREE |
---|
796 | Void TDecEntropy::decodeQP ( TComDataCU* pcCU, UInt uiAbsPartIdx ) |
---|
797 | { |
---|
798 | if ( pcCU->getSlice()->getPPS()->getUseDQP() ) |
---|
799 | { |
---|
800 | m_pcEntropyDecoderIf->parseDeltaQP( pcCU, uiAbsPartIdx, pcCU->getDepth( uiAbsPartIdx ) ); |
---|
801 | } |
---|
802 | } |
---|
803 | #else |
---|
804 | Void TDecEntropy::decodeQP ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
805 | { |
---|
806 | if ( pcCU->getSlice()->getPPS()->getUseDQP() ) |
---|
807 | { |
---|
808 | m_pcEntropyDecoderIf->parseDeltaQP( pcCU, uiAbsPartIdx, uiDepth ); |
---|
809 | } |
---|
810 | } |
---|
811 | #endif |
---|
812 | |
---|
813 | #if !UNIFIED_TRANSFORM_TREE |
---|
814 | Void TDecEntropy::xDecodeCoeff( TComDataCU* pcCU, UInt uiLumaOffset, UInt uiChromaOffset, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, UInt uiTrIdx, UInt uiCurrTrIdx, Bool& bCodeDQP ) |
---|
815 | { |
---|
816 | UInt uiLog2TrSize = g_aucConvertToBit[ pcCU->getSlice()->getSPS()->getMaxCUWidth() >> uiDepth ] + 2; |
---|
817 | UInt uiCbfY = pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrIdx ); |
---|
818 | UInt uiCbfU = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ); |
---|
819 | UInt uiCbfV = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ); |
---|
820 | if( uiLog2TrSize == 2 ) |
---|
821 | { |
---|
822 | UInt uiQPDiv = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 ); |
---|
823 | if( ( uiAbsPartIdx % uiQPDiv ) == 0 ) |
---|
824 | { |
---|
825 | m_uiBakAbsPartIdx = uiAbsPartIdx; |
---|
826 | m_uiBakChromaOffset = uiChromaOffset; |
---|
827 | } |
---|
828 | else if( ( uiAbsPartIdx % uiQPDiv ) == (uiQPDiv - 1) ) |
---|
829 | { |
---|
830 | uiCbfU = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ); |
---|
831 | uiCbfV = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ); |
---|
832 | } |
---|
833 | } |
---|
834 | |
---|
835 | if ( uiCbfY || uiCbfU || uiCbfV ) |
---|
836 | { |
---|
837 | // dQP: only for LCU |
---|
838 | if ( pcCU->getSlice()->getPPS()->getUseDQP() ) |
---|
839 | { |
---|
840 | if ( bCodeDQP ) |
---|
841 | { |
---|
842 | decodeQP( pcCU, uiAbsPartIdx, uiDepth); |
---|
843 | bCodeDQP = false; |
---|
844 | } |
---|
845 | } |
---|
846 | UInt uiLumaTrMode, uiChromaTrMode; |
---|
847 | pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx( uiAbsPartIdx ), uiLumaTrMode, uiChromaTrMode ); |
---|
848 | const UInt uiStopTrMode = uiLumaTrMode; |
---|
849 | |
---|
850 | if( uiTrIdx == uiStopTrMode ) |
---|
851 | { |
---|
852 | if( pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrIdx ) ) |
---|
853 | { |
---|
854 | Int trWidth = uiWidth; |
---|
855 | Int trHeight = uiHeight; |
---|
856 | pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight ); |
---|
857 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffY()+uiLumaOffset), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_LUMA ); |
---|
858 | } |
---|
859 | |
---|
860 | uiWidth >>= 1; |
---|
861 | uiHeight >>= 1; |
---|
862 | |
---|
863 | if( uiLog2TrSize == 2 ) |
---|
864 | { |
---|
865 | UInt uiQPDiv = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 ); |
---|
866 | if( ( uiAbsPartIdx % uiQPDiv ) == (uiQPDiv - 1) ) |
---|
867 | { |
---|
868 | uiWidth <<= 1; |
---|
869 | uiHeight <<= 1; |
---|
870 | Int trWidth = uiWidth; |
---|
871 | Int trHeight = uiHeight; |
---|
872 | pcCU->getNSQTSize( uiTrIdx-1, uiAbsPartIdx, trWidth, trHeight ); |
---|
873 | if( pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ) ) |
---|
874 | { |
---|
875 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCb()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U ); |
---|
876 | } |
---|
877 | if( pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ) ) |
---|
878 | { |
---|
879 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCr()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V ); |
---|
880 | } |
---|
881 | } |
---|
882 | } |
---|
883 | else |
---|
884 | { |
---|
885 | Int trWidth = uiWidth; |
---|
886 | Int trHeight = uiHeight; |
---|
887 | pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight ); |
---|
888 | if( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ) ) |
---|
889 | { |
---|
890 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCb()+uiChromaOffset), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U ); |
---|
891 | } |
---|
892 | if( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ) ) |
---|
893 | { |
---|
894 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCr()+uiChromaOffset), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V ); |
---|
895 | } |
---|
896 | } |
---|
897 | } |
---|
898 | else |
---|
899 | { |
---|
900 | { |
---|
901 | DTRACE_CABAC_VL( g_nSymbolCounter++ ); |
---|
902 | DTRACE_CABAC_T( "\tgoing down\tdepth=" ); |
---|
903 | DTRACE_CABAC_V( uiDepth ); |
---|
904 | DTRACE_CABAC_T( "\ttridx=" ); |
---|
905 | DTRACE_CABAC_V( uiTrIdx ); |
---|
906 | DTRACE_CABAC_T( "\n" ); |
---|
907 | } |
---|
908 | if( uiCurrTrIdx <= uiTrIdx ) |
---|
909 | { |
---|
910 | assert(1); |
---|
911 | } |
---|
912 | UInt uiSize; |
---|
913 | uiWidth >>= 1; |
---|
914 | uiHeight >>= 1; |
---|
915 | uiSize = uiWidth*uiHeight; |
---|
916 | uiDepth++; |
---|
917 | uiTrIdx++; |
---|
918 | |
---|
919 | UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); |
---|
920 | UInt uiIdx = uiAbsPartIdx; |
---|
921 | |
---|
922 | xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP ); |
---|
923 | uiLumaOffset += uiSize; uiChromaOffset += (uiSize>>2); uiIdx += uiQPartNum; |
---|
924 | |
---|
925 | xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP ); |
---|
926 | uiLumaOffset += uiSize; uiChromaOffset += (uiSize>>2); uiIdx += uiQPartNum; |
---|
927 | |
---|
928 | xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP ); |
---|
929 | uiLumaOffset += uiSize; uiChromaOffset += (uiSize>>2); uiIdx += uiQPartNum; |
---|
930 | |
---|
931 | xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP ); |
---|
932 | { |
---|
933 | DTRACE_CABAC_VL( g_nSymbolCounter++ ); |
---|
934 | DTRACE_CABAC_T( "\tgoing up\n" ); |
---|
935 | } |
---|
936 | } |
---|
937 | } |
---|
938 | } |
---|
939 | #endif // !UNIFIED_TRANSFORM_TREE |
---|
940 | |
---|
941 | /** decode coefficients |
---|
942 | * \param pcCU |
---|
943 | * \param uiAbsPartIdx |
---|
944 | * \param uiDepth |
---|
945 | * \param uiWidth |
---|
946 | * \param uiHeight |
---|
947 | * \returns Void |
---|
948 | */ |
---|
949 | Void TDecEntropy::decodeCoeff( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP ) |
---|
950 | { |
---|
951 | UInt uiMinCoeffSize = pcCU->getPic()->getMinCUWidth()*pcCU->getPic()->getMinCUHeight(); |
---|
952 | UInt uiLumaOffset = uiMinCoeffSize*uiAbsPartIdx; |
---|
953 | UInt uiChromaOffset = uiLumaOffset>>2; |
---|
954 | #if UNIFIED_TRANSFORM_TREE |
---|
955 | UInt temp = 0; |
---|
956 | UInt temp1 = 0; |
---|
957 | UInt temp2 = 0; |
---|
958 | #else |
---|
959 | UInt uiLumaTrMode, uiChromaTrMode; |
---|
960 | #endif |
---|
961 | |
---|
962 | #if RWTH_SDC_DLT_B0036 |
---|
963 | if( pcCU->getSDCAvailable(uiAbsPartIdx) && pcCU->getSDCFlag( uiAbsPartIdx ) ) |
---|
964 | { |
---|
965 | assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); |
---|
966 | assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 ); |
---|
967 | assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 ); |
---|
968 | assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); |
---|
969 | assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); |
---|
970 | |
---|
971 | decodeSDCResidualData(pcCU, uiAbsPartIdx, uiDepth); |
---|
972 | return; |
---|
973 | } |
---|
974 | #endif |
---|
975 | |
---|
976 | if( pcCU->isIntra(uiAbsPartIdx) ) |
---|
977 | { |
---|
978 | #if !UNIFIED_TRANSFORM_TREE |
---|
979 | decodeTransformIdx( pcCU, uiAbsPartIdx, pcCU->getDepth(uiAbsPartIdx) ); |
---|
980 | |
---|
981 | pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx(uiAbsPartIdx), uiLumaTrMode, uiChromaTrMode ); |
---|
982 | |
---|
983 | #endif // !UNIFIED_TRANSFORM_TREE |
---|
984 | } |
---|
985 | else |
---|
986 | { |
---|
987 | UInt uiQtRootCbf = 1; |
---|
988 | #if HHI_MPI |
---|
989 | if( !(pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N && |
---|
990 | ( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 || uiDepth == pcCU->getTextureModeDepth( uiAbsPartIdx ) ) ) ) |
---|
991 | #else |
---|
992 | if( !( pcCU->getPartitionSize( uiAbsPartIdx) == SIZE_2Nx2N && pcCU->getMergeFlag( uiAbsPartIdx ) ) ) |
---|
993 | #endif |
---|
994 | { |
---|
995 | m_pcEntropyDecoderIf->parseQtRootCbf( pcCU, uiAbsPartIdx, uiDepth, uiQtRootCbf ); |
---|
996 | } |
---|
997 | if ( !uiQtRootCbf ) |
---|
998 | { |
---|
999 | pcCU->setCbfSubParts( 0, 0, 0, uiAbsPartIdx, uiDepth ); |
---|
1000 | pcCU->setTrIdxSubParts( 0 , uiAbsPartIdx, uiDepth ); |
---|
1001 | pcCU->setNSQTIdxSubParts( uiAbsPartIdx, uiDepth ); |
---|
1002 | return; |
---|
1003 | } |
---|
1004 | |
---|
1005 | #if !UNIFIED_TRANSFORM_TREE |
---|
1006 | decodeTransformIdx( pcCU, uiAbsPartIdx, pcCU->getDepth(uiAbsPartIdx) ); |
---|
1007 | |
---|
1008 | pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx(uiAbsPartIdx), uiLumaTrMode, uiChromaTrMode ); |
---|
1009 | #endif // !UNIFIED_TRANSFORM_TREE |
---|
1010 | } |
---|
1011 | #if UNIFIED_TRANSFORM_TREE |
---|
1012 | xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, 0, temp, temp1, temp2, bCodeDQP ); |
---|
1013 | #else // UNIFIED_TRANSFORM_TREE |
---|
1014 | xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, uiLumaTrMode, bCodeDQP ); |
---|
1015 | #endif // UNIFIED_TRANSFORM_TREE |
---|
1016 | } |
---|
1017 | |
---|
1018 | #if RWTH_SDC_DLT_B0036 |
---|
1019 | Void TDecEntropy::decodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
1020 | { |
---|
1021 | assert( pcCU->getSlice()->getSPS()->isDepth() ); |
---|
1022 | assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); |
---|
1023 | |
---|
1024 | m_pcEntropyDecoderIf->parseSDCPredMode(pcCU, uiAbsPartIdx, uiDepth ); |
---|
1025 | } |
---|
1026 | |
---|
1027 | Void TDecEntropy::decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
1028 | { |
---|
1029 | assert( pcCU->getSlice()->getSPS()->isDepth() ); |
---|
1030 | |
---|
1031 | m_pcEntropyDecoderIf->parseSDCFlag(pcCU, uiAbsPartIdx, uiDepth ); |
---|
1032 | } |
---|
1033 | |
---|
1034 | Void TDecEntropy::decodeSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
1035 | { |
---|
1036 | assert( pcCU->getSlice()->getSPS()->isDepth() ); |
---|
1037 | assert( pcCU->getSDCFlag(uiAbsPartIdx) ); |
---|
1038 | |
---|
1039 | // number of segments depends on prediction mode for INTRA |
---|
1040 | UInt uiNumSegments = 2; |
---|
1041 | UInt uiLumaPredMode = pcCU->getLumaIntraDir( uiAbsPartIdx ); |
---|
1042 | if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTRA && (uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX) ) |
---|
1043 | uiNumSegments = 1; |
---|
1044 | |
---|
1045 | // decode residual data for each segment |
---|
1046 | for( UInt uiSeg = 0; uiSeg < uiNumSegments; uiSeg++ ) |
---|
1047 | m_pcEntropyDecoderIf->parseSDCResidualData(pcCU, uiAbsPartIdx, uiDepth, uiSeg); |
---|
1048 | } |
---|
1049 | #endif |
---|
1050 | |
---|
1051 | //! \} |
---|