[5] | 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 |
---|
[56] | 4 | * granted under this license. |
---|
[5] | 5 | * |
---|
[56] | 6 | * Copyright (c) 2010-2012, ITU/ISO/IEC |
---|
[5] | 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. |
---|
[56] | 17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
[5] | 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 | */ |
---|
[2] | 33 | |
---|
| 34 | /** \file TDecEntropy.cpp |
---|
| 35 | \brief entropy decoder class |
---|
| 36 | */ |
---|
| 37 | |
---|
| 38 | #include "TDecEntropy.h" |
---|
| 39 | |
---|
[56] | 40 | //! \ingroup TLibDecoder |
---|
| 41 | //! \{ |
---|
| 42 | |
---|
[2] | 43 | Void TDecEntropy::setEntropyDecoder ( TDecEntropyIf* p ) |
---|
| 44 | { |
---|
| 45 | m_pcEntropyDecoderIf = p; |
---|
| 46 | } |
---|
| 47 | |
---|
[56] | 48 | #include "TLibCommon/TComAdaptiveLoopFilter.h" |
---|
| 49 | #include "TLibCommon/TComSampleAdaptiveOffset.h" |
---|
[2] | 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 | { |
---|
[56] | 65 | // at least one merge candidate exists |
---|
| 66 | m_pcEntropyDecoderIf->parseMergeFlag( pcSubCU, uiAbsPartIdx, uiDepth, uiPUIdx ); |
---|
[2] | 67 | } |
---|
| 68 | |
---|
[152] | 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 |
---|
[2] | 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; |
---|
[56] | 98 | m_pcEntropyDecoderIf->parseMergeIndex( pcCU, uiMergeIndex, uiAbsPartIdx, uiDepth ); |
---|
[2] | 99 | pcCU->setMergeIndexSubParts( uiMergeIndex, uiAbsPartIdx, uiPartIdx, uiDepth ); |
---|
| 100 | } |
---|
| 101 | |
---|
[5] | 102 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
[2] | 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 | { |
---|
[77] | 117 | bResPredAvailable = pcSubCU->getResidualSamples( uiPUIdx |
---|
| 118 | #if QC_SIMPLIFIEDIVRP_M24938 |
---|
| 119 | , false |
---|
| 120 | #endif |
---|
| 121 | ); |
---|
[2] | 122 | } |
---|
| 123 | |
---|
| 124 | // read from bitstream |
---|
| 125 | if( bResPredAvailable ) |
---|
| 126 | { |
---|
[77] | 127 | #if LG_RESTRICTEDRESPRED_M24766 |
---|
[100] | 128 | Int iPUResiPredShift[4]; |
---|
| 129 | pcCU->getPUResiPredShift(iPUResiPredShift, uiAbsPartIdx); |
---|
| 130 | if(iPUResiPredShift[0] >= 0 || iPUResiPredShift[1] >= 0 || iPUResiPredShift[2] >= 0 || iPUResiPredShift[3] >= 0 ) |
---|
[77] | 131 | #endif |
---|
[2] | 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 | } |
---|
[5] | 139 | #endif |
---|
[2] | 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 | |
---|
| 151 | Void TDecEntropy::decodePartSize( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
| 152 | { |
---|
| 153 | m_pcEntropyDecoderIf->parsePartSize( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 154 | } |
---|
| 155 | |
---|
| 156 | Void TDecEntropy::decodePredInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU ) |
---|
| 157 | { |
---|
| 158 | PartSize eMode = pcCU->getPartitionSize( uiAbsPartIdx ); |
---|
| 159 | |
---|
| 160 | if( pcCU->isIntra( uiAbsPartIdx ) ) // If it is Intra mode, encode intra prediction mode. |
---|
| 161 | { |
---|
| 162 | if( eMode == SIZE_NxN ) // if it is NxN size, encode 4 intra directions. |
---|
| 163 | { |
---|
| 164 | UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth(uiAbsPartIdx) << 1 ) ) >> 2; |
---|
| 165 | // 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. |
---|
| 166 | decodeIntraDirModeLuma( pcCU, uiAbsPartIdx, uiDepth+1 ); |
---|
| 167 | decodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset, uiDepth+1 ); |
---|
| 168 | decodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*2, uiDepth+1 ); |
---|
| 169 | decodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*3, uiDepth+1 ); |
---|
| 170 | decodeIntraDirModeChroma( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 171 | } |
---|
| 172 | else // if it is not NxN size, encode 1 intra directions |
---|
| 173 | { |
---|
| 174 | decodeIntraDirModeLuma ( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 175 | decodeIntraDirModeChroma( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 176 | } |
---|
| 177 | } |
---|
| 178 | else // if it is Inter mode, encode motion vector and reference index |
---|
| 179 | { |
---|
[56] | 180 | decodePUWise( pcCU, uiAbsPartIdx, uiDepth, pcSubCU ); |
---|
| 181 | } |
---|
| 182 | } |
---|
[2] | 183 | |
---|
[56] | 184 | /** Parse I_PCM information. |
---|
| 185 | * \param pcCU pointer to CUpointer to CU |
---|
| 186 | * \param uiAbsPartIdx CU index |
---|
| 187 | * \param uiDepth CU depth |
---|
| 188 | * \returns Void |
---|
| 189 | */ |
---|
| 190 | Void TDecEntropy::decodeIPCMInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
| 191 | { |
---|
| 192 | if(!pcCU->getSlice()->getSPS()->getUsePCM() |
---|
| 193 | || pcCU->getWidth(uiAbsPartIdx) > (1<<pcCU->getSlice()->getSPS()->getPCMLog2MaxSize()) |
---|
| 194 | || pcCU->getWidth(uiAbsPartIdx) < (1<<pcCU->getSlice()->getSPS()->getPCMLog2MinSize()) ) |
---|
| 195 | { |
---|
| 196 | return; |
---|
[2] | 197 | } |
---|
[56] | 198 | |
---|
| 199 | m_pcEntropyDecoderIf->parseIPCMInfo( pcCU, uiAbsPartIdx, uiDepth ); |
---|
[2] | 200 | } |
---|
| 201 | |
---|
| 202 | Void TDecEntropy::decodeIntraDirModeLuma ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
| 203 | { |
---|
| 204 | m_pcEntropyDecoderIf->parseIntraDirLumaAng( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 205 | } |
---|
| 206 | |
---|
| 207 | Void TDecEntropy::decodeIntraDirModeChroma( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
| 208 | { |
---|
| 209 | m_pcEntropyDecoderIf->parseIntraDirChroma( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 210 | } |
---|
| 211 | |
---|
[56] | 212 | /** decode motion information for every PU block. |
---|
[2] | 213 | * \param pcCU |
---|
| 214 | * \param uiAbsPartIdx |
---|
| 215 | * \param uiDepth |
---|
| 216 | * \param pcSubCU |
---|
| 217 | * \returns Void |
---|
| 218 | */ |
---|
| 219 | Void TDecEntropy::decodePUWise( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU ) |
---|
| 220 | { |
---|
| 221 | PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx ); |
---|
| 222 | UInt uiNumPU = ( ePartSize == SIZE_2Nx2N ? 1 : ( ePartSize == SIZE_NxN ? 4 : 2 ) ); |
---|
| 223 | UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxCUDepth() - uiDepth ) << 1 ) ) >> 4; |
---|
| 224 | |
---|
[56] | 225 | #if CU_BASED_MRG_CAND_LIST |
---|
| 226 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
| 227 | TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists |
---|
| 228 | UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; |
---|
| 229 | for ( UInt ui = 0; ui < MRG_MAX_NUM_CANDS_MEM; ui++ ) |
---|
| 230 | #else |
---|
| 231 | TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists |
---|
| 232 | UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS]; |
---|
| 233 | for ( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ui++ ) |
---|
| 234 | #endif |
---|
| 235 | { |
---|
| 236 | uhInterDirNeighbours[ui] = 0; |
---|
| 237 | } |
---|
| 238 | Int numValidMergeCand = 0; |
---|
| 239 | bool isMerged = false; |
---|
| 240 | #endif |
---|
| 241 | |
---|
[2] | 242 | pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 ); |
---|
| 243 | pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 ); |
---|
| 244 | for ( UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset ) |
---|
| 245 | { |
---|
[56] | 246 | #if !CU_BASED_MRG_CAND_LIST |
---|
| 247 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
| 248 | TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists |
---|
| 249 | UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; |
---|
| 250 | Int numValidMergeCand = 0; |
---|
| 251 | for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS_MEM; ++ui ) |
---|
| 252 | #else |
---|
[2] | 253 | TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists |
---|
| 254 | UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS]; |
---|
[56] | 255 | Int numValidMergeCand = 0; |
---|
[2] | 256 | for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ++ui ) |
---|
[56] | 257 | #endif |
---|
[2] | 258 | { |
---|
| 259 | uhInterDirNeighbours[ui] = 0; |
---|
| 260 | } |
---|
| 261 | #endif |
---|
| 262 | decodeMergeFlag( pcCU, uiSubPartIdx, uiDepth, uiPartIdx ); |
---|
| 263 | if ( pcCU->getMergeFlag( uiSubPartIdx ) ) |
---|
| 264 | { |
---|
| 265 | decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, ePartSize, uhInterDirNeighbours, cMvFieldNeighbours, uiDepth ); |
---|
[56] | 266 | #if CU_BASED_MRG_CAND_LIST |
---|
| 267 | UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); |
---|
| 268 | if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 ) |
---|
[2] | 269 | { |
---|
[56] | 270 | pcSubCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); |
---|
| 271 | if ( !isMerged ) |
---|
[2] | 272 | { |
---|
[56] | 273 | pcSubCU->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); |
---|
| 274 | isMerged = true; |
---|
[2] | 275 | } |
---|
[56] | 276 | pcSubCU->setPartSizeSubParts( ePartSize, 0, uiDepth ); |
---|
| 277 | } |
---|
| 278 | else |
---|
| 279 | { |
---|
| 280 | #if SIMP_MRG_PRUN |
---|
| 281 | uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); |
---|
| 282 | pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); |
---|
| 283 | #else |
---|
| 284 | pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); |
---|
| 285 | uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); |
---|
| 286 | #endif |
---|
| 287 | } |
---|
| 288 | #else |
---|
| 289 | #if SIMP_MRG_PRUN |
---|
| 290 | UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); |
---|
| 291 | pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); |
---|
| 292 | #else |
---|
| 293 | pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); |
---|
| 294 | UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); |
---|
| 295 | #endif |
---|
| 296 | #endif |
---|
| 297 | pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); |
---|
| 298 | |
---|
| 299 | TComMv cTmpMv( 0, 0 ); |
---|
| 300 | for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) |
---|
| 301 | { |
---|
| 302 | if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 ) |
---|
[2] | 303 | { |
---|
[56] | 304 | pcCU->setMVPIdxSubParts( 0, RefPicList( uiRefListIdx ), uiSubPartIdx, uiPartIdx, uiDepth); |
---|
| 305 | pcCU->setMVPNumSubParts( 0, RefPicList( uiRefListIdx ), uiSubPartIdx, uiPartIdx, uiDepth); |
---|
| 306 | pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); |
---|
| 307 | pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); |
---|
| 308 | |
---|
[2] | 309 | } |
---|
| 310 | } |
---|
[56] | 311 | } |
---|
| 312 | else |
---|
| 313 | { |
---|
[2] | 314 | decodeInterDirPU( pcCU, uiSubPartIdx, uiDepth, uiPartIdx ); |
---|
| 315 | for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) |
---|
| 316 | { |
---|
| 317 | if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 ) |
---|
| 318 | { |
---|
| 319 | decodeRefFrmIdxPU( pcCU, uiSubPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); |
---|
| 320 | decodeMvdPU ( pcCU, uiSubPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); |
---|
| 321 | decodeMVPIdxPU ( pcSubCU, uiSubPartIdx-uiAbsPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); |
---|
| 322 | } |
---|
| 323 | } |
---|
| 324 | } |
---|
| 325 | } |
---|
| 326 | return; |
---|
| 327 | } |
---|
| 328 | |
---|
| 329 | /** decode inter direction for a PU block |
---|
| 330 | * \param pcCU |
---|
| 331 | * \param uiAbsPartIdx |
---|
| 332 | * \param uiDepth |
---|
| 333 | * \param uiPartIdx |
---|
| 334 | * \returns Void |
---|
| 335 | */ |
---|
| 336 | Void TDecEntropy::decodeInterDirPU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx ) |
---|
| 337 | { |
---|
| 338 | UInt uiInterDir; |
---|
| 339 | |
---|
| 340 | if ( pcCU->getSlice()->isInterP() ) |
---|
| 341 | { |
---|
| 342 | uiInterDir = 1; |
---|
| 343 | } |
---|
| 344 | else |
---|
| 345 | { |
---|
| 346 | m_pcEntropyDecoderIf->parseInterDir( pcCU, uiInterDir, uiAbsPartIdx, uiDepth ); |
---|
| 347 | } |
---|
| 348 | |
---|
| 349 | pcCU->setInterDirSubParts( uiInterDir, uiAbsPartIdx, uiPartIdx, uiDepth ); |
---|
| 350 | } |
---|
| 351 | |
---|
| 352 | Void TDecEntropy::decodeRefFrmIdxPU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList ) |
---|
| 353 | { |
---|
| 354 | if(pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && pcCU->getInterDir( uiAbsPartIdx ) != 3) |
---|
| 355 | { |
---|
| 356 | if(eRefList == REF_PIC_LIST_1) |
---|
| 357 | { |
---|
| 358 | return; |
---|
| 359 | } |
---|
| 360 | |
---|
| 361 | Int iRefFrmIdx = 0; |
---|
| 362 | Int iRefFrmIdxTemp; |
---|
| 363 | UInt uiInterDir; |
---|
| 364 | RefPicList eRefListTemp; |
---|
| 365 | |
---|
| 366 | PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx ); |
---|
| 367 | |
---|
| 368 | if ( pcCU->getSlice()->getNumRefIdx ( REF_PIC_LIST_C ) > 1 ) |
---|
| 369 | { |
---|
| 370 | m_pcEntropyDecoderIf->parseRefFrmIdx( pcCU, iRefFrmIdx, uiAbsPartIdx, uiDepth, REF_PIC_LIST_C ); |
---|
[56] | 371 | } |
---|
| 372 | else |
---|
| 373 | { |
---|
[2] | 374 | iRefFrmIdx=0; |
---|
| 375 | } |
---|
| 376 | uiInterDir = pcCU->getSlice()->getListIdFromIdxOfLC(iRefFrmIdx) + 1; |
---|
| 377 | iRefFrmIdxTemp = pcCU->getSlice()->getRefIdxFromIdxOfLC(iRefFrmIdx); |
---|
| 378 | eRefListTemp = (RefPicList)pcCU->getSlice()->getListIdFromIdxOfLC(iRefFrmIdx); |
---|
| 379 | |
---|
[56] | 380 | pcCU->getCUMvField( eRefListTemp )->setAllRefIdx( iRefFrmIdxTemp, ePartSize, uiAbsPartIdx, uiDepth, uiPartIdx ); |
---|
[2] | 381 | |
---|
| 382 | pcCU->setInterDirSubParts( uiInterDir, uiAbsPartIdx, uiPartIdx, uiDepth ); |
---|
| 383 | } |
---|
| 384 | else |
---|
| 385 | { |
---|
[56] | 386 | Int iRefFrmIdx = 0; |
---|
| 387 | Int iParseRefFrmIdx = pcCU->getInterDir( uiAbsPartIdx ) & ( 1 << eRefList ); |
---|
[2] | 388 | |
---|
[56] | 389 | if ( pcCU->getSlice()->getNumRefIdx( eRefList ) > 1 && iParseRefFrmIdx ) |
---|
| 390 | { |
---|
| 391 | m_pcEntropyDecoderIf->parseRefFrmIdx( pcCU, iRefFrmIdx, uiAbsPartIdx, uiDepth, eRefList ); |
---|
| 392 | } |
---|
| 393 | else if ( !iParseRefFrmIdx ) |
---|
| 394 | { |
---|
| 395 | iRefFrmIdx = NOT_VALID; |
---|
| 396 | } |
---|
| 397 | else |
---|
| 398 | { |
---|
| 399 | iRefFrmIdx = 0; |
---|
| 400 | } |
---|
[2] | 401 | |
---|
[56] | 402 | PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx ); |
---|
| 403 | pcCU->getCUMvField( eRefList )->setAllRefIdx( iRefFrmIdx, ePartSize, uiAbsPartIdx, uiDepth, uiPartIdx ); |
---|
[2] | 404 | } |
---|
| 405 | } |
---|
| 406 | |
---|
| 407 | /** decode motion vector difference for a PU block |
---|
| 408 | * \param pcCU |
---|
| 409 | * \param uiAbsPartIdx |
---|
| 410 | * \param uiDepth |
---|
| 411 | * \param uiPartIdx |
---|
| 412 | * \param eRefList |
---|
| 413 | * \returns Void |
---|
| 414 | */ |
---|
| 415 | Void TDecEntropy::decodeMvdPU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList ) |
---|
| 416 | { |
---|
| 417 | if ( pcCU->getInterDir( uiAbsPartIdx ) & ( 1 << eRefList ) ) |
---|
| 418 | { |
---|
| 419 | m_pcEntropyDecoderIf->parseMvd( pcCU, uiAbsPartIdx, uiPartIdx, uiDepth, eRefList ); |
---|
| 420 | } |
---|
| 421 | } |
---|
| 422 | |
---|
| 423 | Void TDecEntropy::decodeMVPIdxPU( TComDataCU* pcSubCU, UInt uiPartAddr, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList ) |
---|
| 424 | { |
---|
[56] | 425 | Int iMVPIdx = -1; |
---|
[2] | 426 | |
---|
| 427 | TComMv cZeroMv( 0, 0 ); |
---|
| 428 | TComMv cMv = cZeroMv; |
---|
| 429 | Int iRefIdx = -1; |
---|
| 430 | |
---|
| 431 | TComCUMvField* pcSubCUMvField = pcSubCU->getCUMvField( eRefList ); |
---|
| 432 | AMVPInfo* pAMVPInfo = pcSubCUMvField->getAMVPInfo(); |
---|
| 433 | |
---|
| 434 | iRefIdx = pcSubCUMvField->getRefIdx(uiPartAddr); |
---|
| 435 | cMv = cZeroMv; |
---|
[56] | 436 | |
---|
| 437 | if ( (pcSubCU->getInterDir(uiPartAddr) & ( 1 << eRefList )) && (pcSubCU->getAMVPMode(uiPartAddr) == AM_EXPL) ) |
---|
| 438 | { |
---|
| 439 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
| 440 | const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcSubCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 ); |
---|
| 441 | m_pcEntropyDecoderIf->parseMVPIdx( iMVPIdx, iNumAMVPCands ); |
---|
| 442 | #else |
---|
| 443 | m_pcEntropyDecoderIf->parseMVPIdx( iMVPIdx ); |
---|
| 444 | #endif |
---|
| 445 | } |
---|
[2] | 446 | pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo); |
---|
| 447 | pcSubCU->setMVPNumSubParts(pAMVPInfo->iN, eRefList, uiPartAddr, uiPartIdx, uiDepth); |
---|
| 448 | pcSubCU->setMVPIdxSubParts( iMVPIdx, eRefList, uiPartAddr, uiPartIdx, uiDepth ); |
---|
| 449 | if ( iRefIdx >= 0 ) |
---|
| 450 | { |
---|
| 451 | m_pcPrediction->getMvPredAMVP( pcSubCU, uiPartIdx, uiPartAddr, eRefList, iRefIdx, cMv); |
---|
| 452 | cMv += pcSubCUMvField->getMvd( uiPartAddr ); |
---|
| 453 | } |
---|
| 454 | |
---|
| 455 | PartSize ePartSize = pcSubCU->getPartitionSize( uiPartAddr ); |
---|
[56] | 456 | pcSubCU->getCUMvField( eRefList )->setAllMv(cMv, ePartSize, uiPartAddr, 0, uiPartIdx); |
---|
[2] | 457 | } |
---|
| 458 | |
---|
[56] | 459 | #if UNIFIED_TRANSFORM_TREE |
---|
| 460 | 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 ) |
---|
| 461 | #else |
---|
| 462 | Void TDecEntropy::xDecodeTransformSubdiv( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt uiInnerQuadIdx, UInt& uiYCbfFront3, UInt& uiUCbfFront3, UInt& uiVCbfFront3 ) |
---|
| 463 | #endif |
---|
[2] | 464 | { |
---|
[56] | 465 | UInt uiSubdiv; |
---|
| 466 | const UInt uiLog2TrafoSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()]+2 - uiDepth; |
---|
| 467 | |
---|
| 468 | #if UNIFIED_TRANSFORM_TREE |
---|
| 469 | if(uiTrIdx==0) |
---|
| 470 | { |
---|
| 471 | m_bakAbsPartIdxCU = uiAbsPartIdx; |
---|
| 472 | } |
---|
| 473 | if( uiLog2TrafoSize == 2 ) |
---|
| 474 | { |
---|
| 475 | UInt partNum = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 ); |
---|
| 476 | if( ( uiAbsPartIdx % partNum ) == 0 ) |
---|
| 477 | { |
---|
| 478 | m_uiBakAbsPartIdx = uiAbsPartIdx; |
---|
| 479 | m_uiBakChromaOffset = offsetChroma; |
---|
| 480 | } |
---|
| 481 | } |
---|
| 482 | #endif // UNIFIED_TRANSFORM_TREE |
---|
| 483 | if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTRA && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_NxN && uiDepth == pcCU->getDepth(uiAbsPartIdx) ) |
---|
| 484 | { |
---|
| 485 | uiSubdiv = 1; |
---|
| 486 | } |
---|
| 487 | #if G519_TU_AMP_NSQT_HARMONIZATION |
---|
| 488 | else if( (pcCU->getSlice()->getSPS()->getQuadtreeTUMaxDepthInter() == 1) && (pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER) && ( pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N ) && (uiDepth == pcCU->getDepth(uiAbsPartIdx)) ) |
---|
| 489 | #else |
---|
| 490 | 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)) ) |
---|
| 491 | #endif |
---|
| 492 | { |
---|
| 493 | uiSubdiv = (uiLog2TrafoSize > pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx)); |
---|
| 494 | } |
---|
| 495 | else if( uiLog2TrafoSize > pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) |
---|
| 496 | { |
---|
| 497 | uiSubdiv = 1; |
---|
| 498 | } |
---|
| 499 | else if( uiLog2TrafoSize == pcCU->getSlice()->getSPS()->getQuadtreeTULog2MinSize() ) |
---|
| 500 | { |
---|
| 501 | uiSubdiv = 0; |
---|
| 502 | } |
---|
| 503 | else if( uiLog2TrafoSize == pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx) ) |
---|
| 504 | { |
---|
| 505 | uiSubdiv = 0; |
---|
| 506 | } |
---|
| 507 | else |
---|
| 508 | { |
---|
| 509 | assert( uiLog2TrafoSize > pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx) ); |
---|
| 510 | m_pcEntropyDecoderIf->parseTransformSubdivFlag( uiSubdiv, uiDepth ); |
---|
| 511 | } |
---|
[2] | 512 | |
---|
[56] | 513 | const UInt uiTrDepth = uiDepth - pcCU->getDepth( uiAbsPartIdx ); |
---|
[2] | 514 | |
---|
[56] | 515 | if( uiLog2TrafoSize <= pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) |
---|
[2] | 516 | { |
---|
[56] | 517 | const Bool bFirstCbfOfCU = uiLog2TrafoSize == pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() || uiTrDepth == 0; |
---|
| 518 | if( bFirstCbfOfCU ) |
---|
[2] | 519 | { |
---|
[56] | 520 | pcCU->setCbfSubParts( 0, TEXT_CHROMA_U, uiAbsPartIdx, uiDepth ); |
---|
| 521 | pcCU->setCbfSubParts( 0, TEXT_CHROMA_V, uiAbsPartIdx, uiDepth ); |
---|
[2] | 522 | } |
---|
[56] | 523 | if( bFirstCbfOfCU || uiLog2TrafoSize > 2 ) |
---|
[2] | 524 | { |
---|
[56] | 525 | if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) ) |
---|
[2] | 526 | { |
---|
[56] | 527 | if ( uiInnerQuadIdx == 3 && uiUCbfFront3 == 0 && uiLog2TrafoSize < pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) |
---|
[2] | 528 | { |
---|
[56] | 529 | uiUCbfFront3++; |
---|
| 530 | pcCU->setCbfSubParts( 1 << uiTrDepth, TEXT_CHROMA_U, uiAbsPartIdx, uiDepth ); |
---|
| 531 | //printf( " \nsave bits, U Cbf"); |
---|
[2] | 532 | } |
---|
[56] | 533 | else |
---|
[2] | 534 | { |
---|
[56] | 535 | m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth, uiDepth ); |
---|
| 536 | uiUCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth ); |
---|
[2] | 537 | } |
---|
| 538 | } |
---|
[56] | 539 | if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth - 1 ) ) |
---|
[2] | 540 | { |
---|
[56] | 541 | if ( uiInnerQuadIdx == 3 && uiVCbfFront3 == 0 && uiLog2TrafoSize < pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) |
---|
[2] | 542 | { |
---|
[56] | 543 | uiVCbfFront3++; |
---|
| 544 | pcCU->setCbfSubParts( 1 << uiTrDepth, TEXT_CHROMA_V, uiAbsPartIdx, uiDepth ); |
---|
| 545 | //printf( " \nsave bits, V Cbf"); |
---|
[2] | 546 | } |
---|
[56] | 547 | else |
---|
[2] | 548 | { |
---|
[56] | 549 | m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth, uiDepth ); |
---|
| 550 | uiVCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth ); |
---|
[2] | 551 | } |
---|
| 552 | } |
---|
| 553 | } |
---|
[56] | 554 | else |
---|
[2] | 555 | { |
---|
[56] | 556 | pcCU->setCbfSubParts( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) << uiTrDepth, TEXT_CHROMA_U, uiAbsPartIdx, uiDepth ); |
---|
| 557 | pcCU->setCbfSubParts( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth - 1 ) << uiTrDepth, TEXT_CHROMA_V, uiAbsPartIdx, uiDepth ); |
---|
| 558 | if ( uiLog2TrafoSize == 2 ) |
---|
[2] | 559 | { |
---|
[56] | 560 | uiUCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth ); |
---|
| 561 | uiVCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth ); |
---|
[2] | 562 | } |
---|
| 563 | } |
---|
| 564 | } |
---|
| 565 | |
---|
[56] | 566 | if( uiSubdiv ) |
---|
[2] | 567 | { |
---|
[56] | 568 | #if UNIFIED_TRANSFORM_TREE |
---|
| 569 | UInt size; |
---|
| 570 | width >>= 1; |
---|
| 571 | height >>= 1; |
---|
| 572 | size = width*height; |
---|
| 573 | uiTrIdx++; |
---|
| 574 | #endif |
---|
| 575 | ++uiDepth; |
---|
| 576 | const UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); |
---|
| 577 | const UInt uiStartAbsPartIdx = uiAbsPartIdx; |
---|
| 578 | UInt uiLumaTrMode, uiChromaTrMode; |
---|
| 579 | pcCU->convertTransIdx( uiStartAbsPartIdx, uiTrDepth+1, uiLumaTrMode, uiChromaTrMode ); |
---|
| 580 | UInt uiYCbf = 0; |
---|
| 581 | UInt uiUCbf = 0; |
---|
| 582 | UInt uiVCbf = 0; |
---|
| 583 | |
---|
| 584 | UInt uiCurrentCbfY = 0; |
---|
| 585 | UInt uiCurrentCbfU = 0; |
---|
| 586 | UInt uiCurrentCbfV = 0; |
---|
| 587 | |
---|
| 588 | for( Int i = 0; i < 4; i++ ) |
---|
[2] | 589 | { |
---|
[56] | 590 | #if UNIFIED_TRANSFORM_TREE |
---|
| 591 | UInt nsAddr = 0; |
---|
| 592 | nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, i, uiTrDepth+1 ); |
---|
| 593 | xDecodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, nsAddr, uiDepth, width, height, uiTrIdx, i, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV, bCodeDQP ); |
---|
| 594 | #else |
---|
| 595 | UInt nsAddr = 0; |
---|
| 596 | nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, i, uiTrDepth+1 ); |
---|
| 597 | xDecodeTransformSubdiv( pcCU, uiAbsPartIdx, nsAddr, uiDepth, i, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV ); |
---|
| 598 | #endif |
---|
| 599 | uiYCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode ); |
---|
| 600 | uiUCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiChromaTrMode ); |
---|
| 601 | uiVCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiChromaTrMode ); |
---|
| 602 | uiAbsPartIdx += uiQPartNum; |
---|
| 603 | #if UNIFIED_TRANSFORM_TREE |
---|
| 604 | offsetLuma += size; offsetChroma += (size>>2); |
---|
| 605 | #endif |
---|
[2] | 606 | } |
---|
[56] | 607 | |
---|
| 608 | uiYCbfFront3 += uiCurrentCbfY; |
---|
| 609 | uiUCbfFront3 += uiCurrentCbfU; |
---|
| 610 | uiVCbfFront3 += uiCurrentCbfV; |
---|
| 611 | |
---|
| 612 | pcCU->convertTransIdx( uiStartAbsPartIdx, uiTrDepth, uiLumaTrMode, uiChromaTrMode ); |
---|
| 613 | for( UInt ui = 0; ui < 4 * uiQPartNum; ++ui ) |
---|
| 614 | { |
---|
| 615 | pcCU->getCbf( TEXT_LUMA )[uiStartAbsPartIdx + ui] |= uiYCbf << uiLumaTrMode; |
---|
| 616 | pcCU->getCbf( TEXT_CHROMA_U )[uiStartAbsPartIdx + ui] |= uiUCbf << uiChromaTrMode; |
---|
| 617 | pcCU->getCbf( TEXT_CHROMA_V )[uiStartAbsPartIdx + ui] |= uiVCbf << uiChromaTrMode; |
---|
| 618 | } |
---|
[2] | 619 | } |
---|
| 620 | else |
---|
| 621 | { |
---|
[56] | 622 | assert( uiDepth >= pcCU->getDepth( uiAbsPartIdx ) ); |
---|
| 623 | pcCU->setTrIdxSubParts( uiTrDepth, uiAbsPartIdx, uiDepth ); |
---|
| 624 | |
---|
[2] | 625 | { |
---|
[56] | 626 | DTRACE_CABAC_VL( g_nSymbolCounter++ ); |
---|
| 627 | DTRACE_CABAC_T( "\tTrIdx: abspart=" ); |
---|
| 628 | DTRACE_CABAC_V( uiAbsPartIdx ); |
---|
| 629 | DTRACE_CABAC_T( "\tdepth=" ); |
---|
| 630 | DTRACE_CABAC_V( uiDepth ); |
---|
| 631 | DTRACE_CABAC_T( "\ttrdepth=" ); |
---|
| 632 | DTRACE_CABAC_V( uiTrDepth ); |
---|
| 633 | DTRACE_CABAC_T( "\n" ); |
---|
[2] | 634 | } |
---|
[56] | 635 | |
---|
| 636 | UInt uiLumaTrMode, uiChromaTrMode; |
---|
| 637 | pcCU->convertTransIdx( uiAbsPartIdx, uiTrDepth, uiLumaTrMode, uiChromaTrMode ); |
---|
| 638 | if(pcCU->getPredictionMode( uiAbsPartIdx ) == MODE_INTER && pcCU->useNonSquarePU( uiAbsPartIdx ) ) |
---|
[2] | 639 | { |
---|
[56] | 640 | pcCU->setNSQTIdxSubParts( uiLog2TrafoSize, uiAbsPartIdx, absTUPartIdx, uiLumaTrMode ); |
---|
[2] | 641 | } |
---|
[56] | 642 | pcCU->setCbfSubParts ( 0, TEXT_LUMA, uiAbsPartIdx, uiDepth ); |
---|
| 643 | if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) ) |
---|
[2] | 644 | { |
---|
[56] | 645 | pcCU->setCbfSubParts( 1 << uiLumaTrMode, TEXT_LUMA, uiAbsPartIdx, uiDepth ); |
---|
[2] | 646 | } |
---|
[56] | 647 | else |
---|
[2] | 648 | { |
---|
[56] | 649 | const UInt uiLog2CUSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()] + 2 - pcCU->getDepth( uiAbsPartIdx ); |
---|
| 650 | if ( pcCU->getPredictionMode( uiAbsPartIdx ) != MODE_INTRA && uiInnerQuadIdx == 3 && uiYCbfFront3 == 0 && uiUCbfFront3 == 0 && uiVCbfFront3 == 0 |
---|
| 651 | && ( uiLog2CUSize <= pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() + 1 || uiLog2TrafoSize < pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) ) |
---|
[2] | 652 | { |
---|
[56] | 653 | pcCU->setCbfSubParts( 1 << uiLumaTrMode, TEXT_LUMA, uiAbsPartIdx, uiDepth ); |
---|
| 654 | //printf( " \nsave bits, Y Cbf"); |
---|
| 655 | uiYCbfFront3++; |
---|
[2] | 656 | } |
---|
[56] | 657 | else |
---|
[2] | 658 | { |
---|
[56] | 659 | m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode, uiDepth ); |
---|
| 660 | uiYCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode ); |
---|
[2] | 661 | } |
---|
| 662 | } |
---|
[56] | 663 | #if UNIFIED_TRANSFORM_TREE |
---|
| 664 | // transform_unit begin |
---|
| 665 | UInt cbfY = pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA , uiTrIdx ); |
---|
| 666 | UInt cbfU = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ); |
---|
| 667 | UInt cbfV = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ); |
---|
| 668 | if( uiLog2TrafoSize == 2 ) |
---|
[2] | 669 | { |
---|
[56] | 670 | UInt partNum = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 ); |
---|
| 671 | if( ( uiAbsPartIdx % partNum ) == (partNum - 1) ) |
---|
[2] | 672 | { |
---|
[56] | 673 | cbfU = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ); |
---|
| 674 | cbfV = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ); |
---|
[2] | 675 | } |
---|
| 676 | } |
---|
[56] | 677 | if ( cbfY || cbfU || cbfV ) |
---|
[2] | 678 | { |
---|
[56] | 679 | // dQP: only for LCU |
---|
| 680 | if ( pcCU->getSlice()->getPPS()->getUseDQP() ) |
---|
[2] | 681 | { |
---|
[56] | 682 | if ( bCodeDQP ) |
---|
[2] | 683 | { |
---|
[56] | 684 | decodeQP( pcCU, m_bakAbsPartIdxCU); |
---|
| 685 | bCodeDQP = false; |
---|
[2] | 686 | } |
---|
| 687 | } |
---|
| 688 | } |
---|
[56] | 689 | if( cbfY ) |
---|
[2] | 690 | { |
---|
[56] | 691 | Int trWidth = width; |
---|
| 692 | Int trHeight = height; |
---|
| 693 | pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight ); |
---|
| 694 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffY()+offsetLuma), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_LUMA ); |
---|
[2] | 695 | } |
---|
[56] | 696 | if( uiLog2TrafoSize > 2 ) |
---|
[2] | 697 | { |
---|
[56] | 698 | Int trWidth = width >> 1; |
---|
| 699 | Int trHeight = height >> 1; |
---|
| 700 | pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight ); |
---|
| 701 | if( cbfU ) |
---|
[2] | 702 | { |
---|
[56] | 703 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCb()+offsetChroma), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U ); |
---|
[2] | 704 | } |
---|
[56] | 705 | if( cbfV ) |
---|
[2] | 706 | { |
---|
[56] | 707 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCr()+offsetChroma), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V ); |
---|
[2] | 708 | } |
---|
| 709 | } |
---|
| 710 | else |
---|
| 711 | { |
---|
[56] | 712 | UInt partNum = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 ); |
---|
| 713 | if( ( uiAbsPartIdx % partNum ) == (partNum - 1) ) |
---|
[2] | 714 | { |
---|
[56] | 715 | Int trWidth = width; |
---|
| 716 | Int trHeight = height; |
---|
| 717 | pcCU->getNSQTSize( uiTrIdx - 1, uiAbsPartIdx, trWidth, trHeight ); |
---|
| 718 | if( cbfU ) |
---|
[2] | 719 | { |
---|
[56] | 720 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCb()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U ); |
---|
[2] | 721 | } |
---|
[56] | 722 | if( cbfV ) |
---|
[2] | 723 | { |
---|
[56] | 724 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCr()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V ); |
---|
[2] | 725 | } |
---|
| 726 | } |
---|
| 727 | } |
---|
[56] | 728 | // transform_unit end |
---|
| 729 | #endif // UNIFIED_TRANSFORM_TREE |
---|
[2] | 730 | } |
---|
| 731 | } |
---|
| 732 | |
---|
[56] | 733 | #if !UNIFIED_TRANSFORM_TREE |
---|
[2] | 734 | Void TDecEntropy::decodeTransformIdx( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
| 735 | { |
---|
[56] | 736 | DTRACE_CABAC_VL( g_nSymbolCounter++ ) |
---|
[2] | 737 | DTRACE_CABAC_T( "\tdecodeTransformIdx()\tCUDepth=" ) |
---|
| 738 | DTRACE_CABAC_V( uiDepth ) |
---|
| 739 | DTRACE_CABAC_T( "\n" ) |
---|
| 740 | UInt temp = 0; |
---|
| 741 | UInt temp1 = 0; |
---|
| 742 | UInt temp2 = 0; |
---|
[56] | 743 | xDecodeTransformSubdiv( pcCU, uiAbsPartIdx, uiAbsPartIdx, uiDepth, 0, temp, temp1, temp2 ); |
---|
[2] | 744 | } |
---|
[56] | 745 | #endif // UNIFIED_TRANSFORM_TREE |
---|
[2] | 746 | |
---|
[56] | 747 | #if UNIFIED_TRANSFORM_TREE |
---|
| 748 | Void TDecEntropy::decodeQP ( TComDataCU* pcCU, UInt uiAbsPartIdx ) |
---|
| 749 | { |
---|
| 750 | if ( pcCU->getSlice()->getPPS()->getUseDQP() ) |
---|
| 751 | { |
---|
| 752 | m_pcEntropyDecoderIf->parseDeltaQP( pcCU, uiAbsPartIdx, pcCU->getDepth( uiAbsPartIdx ) ); |
---|
| 753 | } |
---|
| 754 | } |
---|
| 755 | #else |
---|
[2] | 756 | Void TDecEntropy::decodeQP ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
| 757 | { |
---|
[56] | 758 | if ( pcCU->getSlice()->getPPS()->getUseDQP() ) |
---|
[2] | 759 | { |
---|
| 760 | m_pcEntropyDecoderIf->parseDeltaQP( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 761 | } |
---|
| 762 | } |
---|
[56] | 763 | #endif |
---|
[2] | 764 | |
---|
[56] | 765 | #if !UNIFIED_TRANSFORM_TREE |
---|
| 766 | Void TDecEntropy::xDecodeCoeff( TComDataCU* pcCU, UInt uiLumaOffset, UInt uiChromaOffset, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, UInt uiTrIdx, UInt uiCurrTrIdx, Bool& bCodeDQP ) |
---|
[2] | 767 | { |
---|
[56] | 768 | UInt uiLog2TrSize = g_aucConvertToBit[ pcCU->getSlice()->getSPS()->getMaxCUWidth() >> uiDepth ] + 2; |
---|
| 769 | UInt uiCbfY = pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrIdx ); |
---|
| 770 | UInt uiCbfU = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ); |
---|
| 771 | UInt uiCbfV = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ); |
---|
| 772 | if( uiLog2TrSize == 2 ) |
---|
| 773 | { |
---|
| 774 | UInt uiQPDiv = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 ); |
---|
| 775 | if( ( uiAbsPartIdx % uiQPDiv ) == 0 ) |
---|
| 776 | { |
---|
| 777 | m_uiBakAbsPartIdx = uiAbsPartIdx; |
---|
| 778 | m_uiBakChromaOffset = uiChromaOffset; |
---|
| 779 | } |
---|
| 780 | else if( ( uiAbsPartIdx % uiQPDiv ) == (uiQPDiv - 1) ) |
---|
| 781 | { |
---|
| 782 | uiCbfU = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ); |
---|
| 783 | uiCbfV = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ); |
---|
| 784 | } |
---|
| 785 | } |
---|
[2] | 786 | |
---|
[56] | 787 | if ( uiCbfY || uiCbfU || uiCbfV ) |
---|
[2] | 788 | { |
---|
| 789 | // dQP: only for LCU |
---|
[56] | 790 | if ( pcCU->getSlice()->getPPS()->getUseDQP() ) |
---|
[2] | 791 | { |
---|
[56] | 792 | if ( bCodeDQP ) |
---|
[2] | 793 | { |
---|
[56] | 794 | decodeQP( pcCU, uiAbsPartIdx, uiDepth); |
---|
| 795 | bCodeDQP = false; |
---|
[2] | 796 | } |
---|
| 797 | } |
---|
| 798 | UInt uiLumaTrMode, uiChromaTrMode; |
---|
| 799 | pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx( uiAbsPartIdx ), uiLumaTrMode, uiChromaTrMode ); |
---|
[56] | 800 | const UInt uiStopTrMode = uiLumaTrMode; |
---|
[2] | 801 | |
---|
| 802 | if( uiTrIdx == uiStopTrMode ) |
---|
| 803 | { |
---|
[56] | 804 | if( pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrIdx ) ) |
---|
[2] | 805 | { |
---|
[56] | 806 | Int trWidth = uiWidth; |
---|
| 807 | Int trHeight = uiHeight; |
---|
| 808 | pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight ); |
---|
| 809 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffY()+uiLumaOffset), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_LUMA ); |
---|
| 810 | } |
---|
| 811 | |
---|
| 812 | uiWidth >>= 1; |
---|
| 813 | uiHeight >>= 1; |
---|
| 814 | |
---|
| 815 | if( uiLog2TrSize == 2 ) |
---|
| 816 | { |
---|
[2] | 817 | UInt uiQPDiv = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 ); |
---|
[56] | 818 | if( ( uiAbsPartIdx % uiQPDiv ) == (uiQPDiv - 1) ) |
---|
[2] | 819 | { |
---|
[56] | 820 | uiWidth <<= 1; |
---|
| 821 | uiHeight <<= 1; |
---|
| 822 | Int trWidth = uiWidth; |
---|
| 823 | Int trHeight = uiHeight; |
---|
| 824 | pcCU->getNSQTSize( uiTrIdx-1, uiAbsPartIdx, trWidth, trHeight ); |
---|
| 825 | if( pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ) ) |
---|
| 826 | { |
---|
| 827 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCb()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U ); |
---|
| 828 | } |
---|
| 829 | if( pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ) ) |
---|
| 830 | { |
---|
| 831 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCr()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V ); |
---|
| 832 | } |
---|
[2] | 833 | } |
---|
| 834 | } |
---|
[56] | 835 | else |
---|
| 836 | { |
---|
| 837 | Int trWidth = uiWidth; |
---|
| 838 | Int trHeight = uiHeight; |
---|
| 839 | pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight ); |
---|
| 840 | if( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ) ) |
---|
| 841 | { |
---|
| 842 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCb()+uiChromaOffset), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U ); |
---|
| 843 | } |
---|
| 844 | if( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ) ) |
---|
| 845 | { |
---|
| 846 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCr()+uiChromaOffset), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V ); |
---|
| 847 | } |
---|
| 848 | } |
---|
[2] | 849 | } |
---|
| 850 | else |
---|
| 851 | { |
---|
| 852 | { |
---|
[56] | 853 | DTRACE_CABAC_VL( g_nSymbolCounter++ ); |
---|
[2] | 854 | DTRACE_CABAC_T( "\tgoing down\tdepth=" ); |
---|
| 855 | DTRACE_CABAC_V( uiDepth ); |
---|
| 856 | DTRACE_CABAC_T( "\ttridx=" ); |
---|
| 857 | DTRACE_CABAC_V( uiTrIdx ); |
---|
| 858 | DTRACE_CABAC_T( "\n" ); |
---|
| 859 | } |
---|
| 860 | if( uiCurrTrIdx <= uiTrIdx ) |
---|
[56] | 861 | { |
---|
[2] | 862 | assert(1); |
---|
[56] | 863 | } |
---|
[2] | 864 | UInt uiSize; |
---|
| 865 | uiWidth >>= 1; |
---|
| 866 | uiHeight >>= 1; |
---|
| 867 | uiSize = uiWidth*uiHeight; |
---|
| 868 | uiDepth++; |
---|
| 869 | uiTrIdx++; |
---|
| 870 | |
---|
| 871 | UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); |
---|
| 872 | UInt uiIdx = uiAbsPartIdx; |
---|
| 873 | |
---|
[56] | 874 | xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP ); |
---|
| 875 | uiLumaOffset += uiSize; uiChromaOffset += (uiSize>>2); uiIdx += uiQPartNum; |
---|
| 876 | |
---|
| 877 | xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP ); |
---|
| 878 | uiLumaOffset += uiSize; uiChromaOffset += (uiSize>>2); uiIdx += uiQPartNum; |
---|
| 879 | |
---|
| 880 | xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP ); |
---|
| 881 | uiLumaOffset += uiSize; uiChromaOffset += (uiSize>>2); uiIdx += uiQPartNum; |
---|
| 882 | |
---|
| 883 | xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP ); |
---|
[2] | 884 | { |
---|
[56] | 885 | DTRACE_CABAC_VL( g_nSymbolCounter++ ); |
---|
[2] | 886 | DTRACE_CABAC_T( "\tgoing up\n" ); |
---|
| 887 | } |
---|
| 888 | } |
---|
| 889 | } |
---|
| 890 | } |
---|
[56] | 891 | #endif // !UNIFIED_TRANSFORM_TREE |
---|
[2] | 892 | |
---|
| 893 | /** decode coefficients |
---|
| 894 | * \param pcCU |
---|
| 895 | * \param uiAbsPartIdx |
---|
| 896 | * \param uiDepth |
---|
| 897 | * \param uiWidth |
---|
| 898 | * \param uiHeight |
---|
| 899 | * \returns Void |
---|
| 900 | */ |
---|
[56] | 901 | Void TDecEntropy::decodeCoeff( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP ) |
---|
[2] | 902 | { |
---|
| 903 | UInt uiMinCoeffSize = pcCU->getPic()->getMinCUWidth()*pcCU->getPic()->getMinCUHeight(); |
---|
| 904 | UInt uiLumaOffset = uiMinCoeffSize*uiAbsPartIdx; |
---|
| 905 | UInt uiChromaOffset = uiLumaOffset>>2; |
---|
[56] | 906 | #if UNIFIED_TRANSFORM_TREE |
---|
| 907 | UInt temp = 0; |
---|
| 908 | UInt temp1 = 0; |
---|
| 909 | UInt temp2 = 0; |
---|
| 910 | #else |
---|
[2] | 911 | UInt uiLumaTrMode, uiChromaTrMode; |
---|
[56] | 912 | #endif |
---|
[2] | 913 | |
---|
| 914 | if( pcCU->isIntra(uiAbsPartIdx) ) |
---|
| 915 | { |
---|
[56] | 916 | #if !UNIFIED_TRANSFORM_TREE |
---|
[2] | 917 | decodeTransformIdx( pcCU, uiAbsPartIdx, pcCU->getDepth(uiAbsPartIdx) ); |
---|
| 918 | |
---|
| 919 | pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx(uiAbsPartIdx), uiLumaTrMode, uiChromaTrMode ); |
---|
| 920 | |
---|
[56] | 921 | #endif // !UNIFIED_TRANSFORM_TREE |
---|
[2] | 922 | } |
---|
| 923 | else |
---|
| 924 | { |
---|
[56] | 925 | UInt uiQtRootCbf = 1; |
---|
[5] | 926 | #if HHI_MPI |
---|
[56] | 927 | if( !(pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N && |
---|
| 928 | ( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 || uiDepth == pcCU->getTextureModeDepth( uiAbsPartIdx ) ) ) ) |
---|
[2] | 929 | #else |
---|
[56] | 930 | if( !( pcCU->getPartitionSize( uiAbsPartIdx) == SIZE_2Nx2N && pcCU->getMergeFlag( uiAbsPartIdx ) ) ) |
---|
[2] | 931 | #endif |
---|
[56] | 932 | { |
---|
[2] | 933 | m_pcEntropyDecoderIf->parseQtRootCbf( pcCU, uiAbsPartIdx, uiDepth, uiQtRootCbf ); |
---|
| 934 | } |
---|
[56] | 935 | if ( !uiQtRootCbf ) |
---|
| 936 | { |
---|
| 937 | pcCU->setCbfSubParts( 0, 0, 0, uiAbsPartIdx, uiDepth ); |
---|
| 938 | pcCU->setTrIdxSubParts( 0 , uiAbsPartIdx, uiDepth ); |
---|
| 939 | pcCU->setNSQTIdxSubParts( uiAbsPartIdx, uiDepth ); |
---|
| 940 | return; |
---|
| 941 | } |
---|
[2] | 942 | |
---|
[56] | 943 | #if !UNIFIED_TRANSFORM_TREE |
---|
[2] | 944 | decodeTransformIdx( pcCU, uiAbsPartIdx, pcCU->getDepth(uiAbsPartIdx) ); |
---|
| 945 | |
---|
| 946 | pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx(uiAbsPartIdx), uiLumaTrMode, uiChromaTrMode ); |
---|
[56] | 947 | #endif // !UNIFIED_TRANSFORM_TREE |
---|
[2] | 948 | } |
---|
[56] | 949 | #if UNIFIED_TRANSFORM_TREE |
---|
| 950 | xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, 0, temp, temp1, temp2, bCodeDQP ); |
---|
| 951 | #else // UNIFIED_TRANSFORM_TREE |
---|
| 952 | xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, uiLumaTrMode, bCodeDQP ); |
---|
| 953 | #endif // UNIFIED_TRANSFORM_TREE |
---|
[2] | 954 | } |
---|
| 955 | |
---|
[56] | 956 | //! \} |
---|