[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 | * |
---|
[1179] | 6 | * Copyright (c) 2010-2015, 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/TComSampleAdaptiveOffset.h" |
---|
[2] | 49 | |
---|
| 50 | Void TDecEntropy::decodeSkipFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
| 51 | { |
---|
| 52 | m_pcEntropyDecoderIf->parseSkipFlag( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 53 | } |
---|
[1196] | 54 | #if H_3D |
---|
[1179] | 55 | Void TDecEntropy::decodeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
| 56 | { |
---|
| 57 | if( !pcCU->getSlice()->getDepthIntraSkipFlag() ) |
---|
| 58 | { |
---|
| 59 | return; |
---|
| 60 | } |
---|
| 61 | |
---|
| 62 | m_pcEntropyDecoderIf->parseDIS( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 63 | } |
---|
[1039] | 64 | #endif |
---|
[1179] | 65 | |
---|
[608] | 66 | Void TDecEntropy::decodeCUTransquantBypassFlag(TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
| 67 | { |
---|
| 68 | m_pcEntropyDecoderIf->parseCUTransquantBypassFlag( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 69 | } |
---|
| 70 | |
---|
[2] | 71 | /** decode merge flag |
---|
| 72 | * \param pcSubCU |
---|
| 73 | * \param uiAbsPartIdx |
---|
| 74 | * \param uiDepth |
---|
| 75 | * \param uiPUIdx |
---|
| 76 | * \returns Void |
---|
| 77 | */ |
---|
| 78 | Void TDecEntropy::decodeMergeFlag( TComDataCU* pcSubCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ) |
---|
| 79 | { |
---|
[56] | 80 | // at least one merge candidate exists |
---|
| 81 | m_pcEntropyDecoderIf->parseMergeFlag( pcSubCU, uiAbsPartIdx, uiDepth, uiPUIdx ); |
---|
[2] | 82 | } |
---|
| 83 | |
---|
| 84 | /** decode merge index |
---|
| 85 | * \param pcCU |
---|
| 86 | * \param uiPartIdx |
---|
| 87 | * \param uiAbsPartIdx |
---|
| 88 | * \param puhInterDirNeighbours pointer to list of inter direction from the casual neighbours |
---|
| 89 | * \param pcMvFieldNeighbours pointer to list of motion vector field from the casual neighbours |
---|
| 90 | * \param uiDepth |
---|
| 91 | * \returns Void |
---|
| 92 | */ |
---|
[608] | 93 | Void TDecEntropy::decodeMergeIndex( TComDataCU* pcCU, UInt uiPartIdx, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
[2] | 94 | { |
---|
| 95 | UInt uiMergeIndex = 0; |
---|
[608] | 96 | m_pcEntropyDecoderIf->parseMergeIndex( pcCU, uiMergeIndex ); |
---|
[2] | 97 | pcCU->setMergeIndexSubParts( uiMergeIndex, uiAbsPartIdx, uiPartIdx, uiDepth ); |
---|
| 98 | } |
---|
| 99 | |
---|
[608] | 100 | #if H_3D_ARP |
---|
| 101 | Void TDecEntropy::decodeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
[443] | 102 | { |
---|
[608] | 103 | if( !pcCU->getSlice()->getARPStepNum() || pcCU->isIntra( uiAbsPartIdx ) ) |
---|
| 104 | { |
---|
[443] | 105 | return; |
---|
[608] | 106 | } |
---|
| 107 | |
---|
| 108 | if( pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N ) |
---|
| 109 | { |
---|
| 110 | pcCU->setARPWSubParts( 0 , uiAbsPartIdx, uiDepth ); |
---|
| 111 | } |
---|
[443] | 112 | else |
---|
[608] | 113 | { |
---|
[443] | 114 | m_pcEntropyDecoderIf->parseARPW( pcCU , uiAbsPartIdx , uiDepth ); |
---|
[608] | 115 | } |
---|
[443] | 116 | } |
---|
| 117 | #endif |
---|
[608] | 118 | |
---|
| 119 | #if H_3D_IC |
---|
| 120 | Void TDecEntropy::decodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
| 121 | { |
---|
| 122 | pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth ); |
---|
| 123 | |
---|
[833] | 124 | if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() || pcCU->getARPW( uiAbsPartIdx ) > 0 ) |
---|
[608] | 125 | { |
---|
| 126 | return; |
---|
| 127 | } |
---|
| 128 | |
---|
| 129 | if( !pcCU->getSlice()->getApplyIC() ) |
---|
| 130 | return; |
---|
| 131 | |
---|
| 132 | if( pcCU->isICFlagRequired( uiAbsPartIdx ) ) |
---|
| 133 | m_pcEntropyDecoderIf->parseICFlag( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 134 | } |
---|
| 135 | #endif |
---|
| 136 | |
---|
[2] | 137 | Void TDecEntropy::decodeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
| 138 | { |
---|
| 139 | m_pcEntropyDecoderIf->parseSplitFlag( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 140 | } |
---|
| 141 | |
---|
| 142 | Void TDecEntropy::decodePredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
| 143 | { |
---|
| 144 | m_pcEntropyDecoderIf->parsePredMode( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 145 | } |
---|
| 146 | |
---|
| 147 | Void TDecEntropy::decodePartSize( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
| 148 | { |
---|
| 149 | m_pcEntropyDecoderIf->parsePartSize( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 150 | } |
---|
| 151 | |
---|
| 152 | Void TDecEntropy::decodePredInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU ) |
---|
| 153 | { |
---|
| 154 | if( pcCU->isIntra( uiAbsPartIdx ) ) // If it is Intra mode, encode intra prediction mode. |
---|
| 155 | { |
---|
[608] | 156 | decodeIntraDirModeLuma ( pcCU, uiAbsPartIdx, uiDepth ); |
---|
[1196] | 157 | #if H_3D_DIM_SDC |
---|
[1179] | 158 | decodeSDCFlag ( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 159 | #if H_3D_DISABLE_CHROMA |
---|
| 160 | if(!pcCU->getSDCFlag(uiAbsPartIdx) && pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 ) |
---|
| 161 | #else |
---|
[608] | 162 | if(!pcCU->getSDCFlag(uiAbsPartIdx)) |
---|
[443] | 163 | #endif |
---|
[1179] | 164 | #endif |
---|
[608] | 165 | decodeIntraDirModeChroma( pcCU, uiAbsPartIdx, uiDepth ); |
---|
[2] | 166 | } |
---|
| 167 | else // if it is Inter mode, encode motion vector and reference index |
---|
| 168 | { |
---|
[56] | 169 | decodePUWise( pcCU, uiAbsPartIdx, uiDepth, pcSubCU ); |
---|
| 170 | } |
---|
| 171 | } |
---|
[2] | 172 | |
---|
[56] | 173 | /** Parse I_PCM information. |
---|
| 174 | * \param pcCU pointer to CUpointer to CU |
---|
| 175 | * \param uiAbsPartIdx CU index |
---|
| 176 | * \param uiDepth CU depth |
---|
| 177 | * \returns Void |
---|
| 178 | */ |
---|
| 179 | Void TDecEntropy::decodeIPCMInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
| 180 | { |
---|
| 181 | if(!pcCU->getSlice()->getSPS()->getUsePCM() |
---|
| 182 | || pcCU->getWidth(uiAbsPartIdx) > (1<<pcCU->getSlice()->getSPS()->getPCMLog2MaxSize()) |
---|
| 183 | || pcCU->getWidth(uiAbsPartIdx) < (1<<pcCU->getSlice()->getSPS()->getPCMLog2MinSize()) ) |
---|
| 184 | { |
---|
| 185 | return; |
---|
[2] | 186 | } |
---|
[189] | 187 | |
---|
[56] | 188 | m_pcEntropyDecoderIf->parseIPCMInfo( pcCU, uiAbsPartIdx, uiDepth ); |
---|
[2] | 189 | } |
---|
| 190 | |
---|
| 191 | Void TDecEntropy::decodeIntraDirModeLuma ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
| 192 | { |
---|
| 193 | m_pcEntropyDecoderIf->parseIntraDirLumaAng( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 194 | } |
---|
| 195 | |
---|
| 196 | Void TDecEntropy::decodeIntraDirModeChroma( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
| 197 | { |
---|
| 198 | m_pcEntropyDecoderIf->parseIntraDirChroma( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 199 | } |
---|
| 200 | |
---|
[56] | 201 | /** decode motion information for every PU block. |
---|
[2] | 202 | * \param pcCU |
---|
| 203 | * \param uiAbsPartIdx |
---|
| 204 | * \param uiDepth |
---|
| 205 | * \param pcSubCU |
---|
| 206 | * \returns Void |
---|
| 207 | */ |
---|
| 208 | Void TDecEntropy::decodePUWise( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU ) |
---|
| 209 | { |
---|
| 210 | PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx ); |
---|
| 211 | UInt uiNumPU = ( ePartSize == SIZE_2Nx2N ? 1 : ( ePartSize == SIZE_NxN ? 4 : 2 ) ); |
---|
| 212 | UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxCUDepth() - uiDepth ) << 1 ) ) >> 4; |
---|
| 213 | |
---|
[608] | 214 | #if H_3D_IV_MERGE |
---|
[56] | 215 | TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists |
---|
| 216 | UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; |
---|
| 217 | #else |
---|
| 218 | TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists |
---|
| 219 | UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS]; |
---|
| 220 | #endif |
---|
[773] | 221 | #if H_3D_SPIVMP |
---|
[1196] | 222 | Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM]; |
---|
| 223 | TComMvField* pcMvFieldSP = new TComMvField[pcCU->getPic()->getPicSym()->getNumPartition()*2]; |
---|
| 224 | UChar* puhInterDirSP = new UChar[pcCU->getPic()->getPicSym()->getNumPartition()]; |
---|
[724] | 225 | #endif |
---|
[608] | 226 | for ( UInt ui = 0; ui < pcCU->getSlice()->getMaxNumMergeCand(); ui++ ) |
---|
[56] | 227 | { |
---|
| 228 | uhInterDirNeighbours[ui] = 0; |
---|
| 229 | } |
---|
| 230 | Int numValidMergeCand = 0; |
---|
[608] | 231 | Bool isMerged = false; |
---|
[56] | 232 | |
---|
[2] | 233 | pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 ); |
---|
| 234 | pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 ); |
---|
[608] | 235 | #if H_3D_IV_MERGE |
---|
| 236 | pcSubCU->copyDVInfoFrom( pcCU, uiAbsPartIdx); |
---|
| 237 | #endif |
---|
[1196] | 238 | #if H_3D |
---|
[2] | 239 | for ( UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset ) |
---|
| 240 | { |
---|
[608] | 241 | #if H_MV_ENC_DEC_TRAC |
---|
| 242 | DTRACE_PU_S("=========== prediction_unit ===========\n") |
---|
| 243 | // ToDo: |
---|
| 244 | //DTRACE_PU("x0", uiLPelX) |
---|
| 245 | //DTRACE_PU("x1", uiTPelY) |
---|
[56] | 246 | #endif |
---|
[1179] | 247 | |
---|
| 248 | ////// Parse PUs syntax |
---|
[2] | 249 | decodeMergeFlag( pcCU, uiSubPartIdx, uiDepth, uiPartIdx ); |
---|
| 250 | if ( pcCU->getMergeFlag( uiSubPartIdx ) ) |
---|
| 251 | { |
---|
[1179] | 252 | decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, uiDepth ); |
---|
| 253 | } |
---|
| 254 | else |
---|
| 255 | { |
---|
| 256 | decodeInterDirPU( pcCU, uiSubPartIdx, uiDepth, uiPartIdx ); |
---|
| 257 | for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) |
---|
| 258 | { |
---|
| 259 | if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 ) |
---|
| 260 | { |
---|
| 261 | decodeRefFrmIdxPU( pcCU, uiSubPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); |
---|
| 262 | decodeMvdPU ( pcCU, uiSubPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); |
---|
| 263 | decodeMVPIdxPU ( pcSubCU, uiSubPartIdx-uiAbsPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); |
---|
| 264 | } |
---|
| 265 | } |
---|
| 266 | } |
---|
| 267 | } |
---|
| 268 | |
---|
| 269 | ////// Parse CUs extension syntax |
---|
| 270 | decodeDBBPFlag( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 271 | decodeSDCFlag ( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 272 | |
---|
| 273 | #if H_3D_ARP |
---|
| 274 | decodeARPW ( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 275 | #endif |
---|
| 276 | #if H_3D_IC |
---|
| 277 | decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 278 | #endif |
---|
| 279 | |
---|
| 280 | ////// Decode motion vectors |
---|
| 281 | for ( UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset ) |
---|
| 282 | { |
---|
| 283 | if ( pcCU->getMergeFlag( uiSubPartIdx ) ) |
---|
| 284 | { |
---|
| 285 | UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); |
---|
| 286 | #if H_3D_DBBP |
---|
| 287 | if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 && pcCU->getDBBPFlag(uiAbsPartIdx) == false ) |
---|
| 288 | #else |
---|
| 289 | if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 ) |
---|
| 290 | #endif |
---|
| 291 | { |
---|
| 292 | pcSubCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); |
---|
| 293 | if ( !isMerged ) |
---|
| 294 | { |
---|
| 295 | #if H_3D_VSP |
---|
| 296 | Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; |
---|
| 297 | memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); |
---|
| 298 | #if H_3D_SPIVMP |
---|
| 299 | memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); |
---|
| 300 | #endif |
---|
| 301 | pcSubCU->initAvailableFlags(); |
---|
| 302 | pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand); |
---|
| 303 | pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours |
---|
| 304 | #if H_3D_SPIVMP |
---|
| 305 | , pcMvFieldSP, puhInterDirSP |
---|
| 306 | #endif |
---|
| 307 | , numValidMergeCand ); |
---|
| 308 | pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag |
---|
| 309 | #if H_3D_SPIVMP |
---|
| 310 | , bSPIVMPFlag |
---|
| 311 | #endif |
---|
| 312 | , numValidMergeCand ); |
---|
| 313 | pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); |
---|
| 314 | |
---|
| 315 | #else |
---|
| 316 | #if H_3D |
---|
| 317 | pcSubCU->initAvailableFlags(); |
---|
| 318 | pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand); |
---|
| 319 | pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); |
---|
| 320 | |
---|
| 321 | #else |
---|
| 322 | pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); |
---|
| 323 | #endif |
---|
| 324 | #endif |
---|
| 325 | isMerged = true; |
---|
| 326 | } |
---|
| 327 | pcSubCU->setPartSizeSubParts( ePartSize, 0, uiDepth ); |
---|
| 328 | } |
---|
| 329 | else |
---|
| 330 | { |
---|
| 331 | uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); |
---|
| 332 | #if H_3D_VSP |
---|
| 333 | Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; |
---|
| 334 | memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); |
---|
| 335 | #if H_3D_SPIVMP |
---|
| 336 | memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); |
---|
| 337 | #endif |
---|
| 338 | pcSubCU->initAvailableFlags(); |
---|
| 339 | pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); |
---|
| 340 | pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours |
---|
| 341 | #if H_3D_SPIVMP |
---|
| 342 | , pcMvFieldSP, puhInterDirSP |
---|
| 343 | #endif |
---|
| 344 | ,numValidMergeCand, uiMergeIndex ); |
---|
| 345 | pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag |
---|
| 346 | #if H_3D_SPIVMP |
---|
| 347 | , bSPIVMPFlag |
---|
| 348 | #endif |
---|
| 349 | ,numValidMergeCand ); |
---|
| 350 | pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); |
---|
| 351 | #else |
---|
| 352 | #if H_3D |
---|
| 353 | pcSubCU->initAvailableFlags(); |
---|
| 354 | pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); |
---|
| 355 | pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); |
---|
| 356 | #else |
---|
| 357 | pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); |
---|
| 358 | #endif |
---|
| 359 | #endif |
---|
| 360 | } |
---|
| 361 | pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); |
---|
| 362 | |
---|
| 363 | TComMv cTmpMv( 0, 0 ); |
---|
| 364 | for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) |
---|
| 365 | { |
---|
| 366 | if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 ) |
---|
| 367 | { |
---|
| 368 | pcCU->setMVPIdxSubParts( 0, RefPicList( uiRefListIdx ), uiSubPartIdx, uiPartIdx, uiDepth); |
---|
| 369 | pcCU->setMVPNumSubParts( 0, RefPicList( uiRefListIdx ), uiSubPartIdx, uiPartIdx, uiDepth); |
---|
| 370 | pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); |
---|
| 371 | pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); |
---|
| 372 | #if H_3D_VSP |
---|
| 373 | #if H_3D_DBBP |
---|
| 374 | if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 && !pcCU->getDBBPFlag( uiAbsPartIdx ) ) |
---|
| 375 | #else |
---|
| 376 | if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 ) |
---|
| 377 | #endif |
---|
| 378 | { |
---|
| 379 | if ( uhInterDirNeighbours[ uiMergeIndex ] & (1<<uiRefListIdx) ) |
---|
| 380 | { |
---|
| 381 | UInt dummy; |
---|
| 382 | Int vspSize; |
---|
| 383 | Int width, height; |
---|
| 384 | pcCU->getPartIndexAndSize( uiPartIdx, dummy, width, height, uiSubPartIdx, pcCU->getTotalNumPart()==256 ); |
---|
| 385 | pcCU->setMvFieldPUForVSP( pcCU, uiSubPartIdx, width, height, RefPicList( uiRefListIdx ), cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getRefIdx(), vspSize ); |
---|
| 386 | pcCU->setVSPFlag( uiSubPartIdx, vspSize ); |
---|
| 387 | } |
---|
| 388 | } |
---|
| 389 | #endif |
---|
| 390 | } |
---|
| 391 | } |
---|
| 392 | #if H_3D_SPIVMP |
---|
| 393 | pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); |
---|
| 394 | if (bSPIVMPFlag[uiMergeIndex] != 0) |
---|
| 395 | { |
---|
| 396 | Int iWidth, iHeight; |
---|
| 397 | UInt uiIdx; |
---|
| 398 | pcCU->getPartIndexAndSize( uiPartIdx, uiIdx, iWidth, iHeight, uiSubPartIdx, true ); |
---|
| 399 | |
---|
| 400 | UInt uiSPAddr; |
---|
| 401 | |
---|
| 402 | Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight; |
---|
| 403 | |
---|
| 404 | pcCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight); |
---|
| 405 | |
---|
| 406 | for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++) |
---|
| 407 | { |
---|
| 408 | pcCU->getSPAbsPartIdx(uiSubPartIdx, iSPWidth, iSPHeight, iPartitionIdx, iNumSPInOneLine, uiSPAddr); |
---|
| 409 | pcCU->setInterDirSP(puhInterDirSP[iPartitionIdx], uiSPAddr, iSPWidth, iSPHeight); |
---|
| 410 | pcCU->getCUMvField( REF_PIC_LIST_0 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx], iSPWidth, iSPHeight); |
---|
| 411 | pcCU->getCUMvField( REF_PIC_LIST_1 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx + 1], iSPWidth, iSPHeight); |
---|
| 412 | } |
---|
| 413 | } |
---|
| 414 | #endif |
---|
| 415 | } |
---|
| 416 | else |
---|
| 417 | { |
---|
| 418 | for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) |
---|
| 419 | { |
---|
| 420 | if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 ) |
---|
| 421 | { |
---|
| 422 | decodeMvsAMVP ( pcSubCU, uiSubPartIdx-uiAbsPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); |
---|
| 423 | } |
---|
| 424 | } |
---|
| 425 | } |
---|
| 426 | |
---|
| 427 | if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) ) |
---|
| 428 | { |
---|
| 429 | pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMv( TComMv(0,0), ePartSize, uiSubPartIdx, uiDepth, uiPartIdx); |
---|
| 430 | pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllRefIdx( -1, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx); |
---|
| 431 | pcCU->setInterDirSubParts( 1, uiSubPartIdx, uiPartIdx, uiDepth); |
---|
| 432 | } |
---|
| 433 | } |
---|
| 434 | #else |
---|
| 435 | for ( UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset ) |
---|
| 436 | { |
---|
| 437 | #if H_MV_ENC_DEC_TRAC |
---|
| 438 | DTRACE_PU_S("=========== prediction_unit ===========\n") |
---|
| 439 | // ToDo: |
---|
| 440 | //DTRACE_PU("x0", uiLPelX) |
---|
| 441 | //DTRACE_PU("x1", uiTPelY) |
---|
| 442 | #endif |
---|
| 443 | decodeMergeFlag( pcCU, uiSubPartIdx, uiDepth, uiPartIdx ); |
---|
| 444 | if ( pcCU->getMergeFlag( uiSubPartIdx ) ) |
---|
| 445 | { |
---|
[608] | 446 | decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, uiDepth ); |
---|
[56] | 447 | UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); |
---|
| 448 | if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 ) |
---|
[2] | 449 | { |
---|
[56] | 450 | pcSubCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); |
---|
| 451 | if ( !isMerged ) |
---|
[2] | 452 | { |
---|
[608] | 453 | pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); |
---|
[56] | 454 | isMerged = true; |
---|
[2] | 455 | } |
---|
[56] | 456 | pcSubCU->setPartSizeSubParts( ePartSize, 0, uiDepth ); |
---|
| 457 | } |
---|
| 458 | else |
---|
| 459 | { |
---|
[622] | 460 | uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); |
---|
[724] | 461 | pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); |
---|
[56] | 462 | } |
---|
| 463 | pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); |
---|
[833] | 464 | |
---|
[56] | 465 | TComMv cTmpMv( 0, 0 ); |
---|
| 466 | for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) |
---|
| 467 | { |
---|
| 468 | if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 ) |
---|
[2] | 469 | { |
---|
[56] | 470 | pcCU->setMVPIdxSubParts( 0, RefPicList( uiRefListIdx ), uiSubPartIdx, uiPartIdx, uiDepth); |
---|
| 471 | pcCU->setMVPNumSubParts( 0, RefPicList( uiRefListIdx ), uiSubPartIdx, uiPartIdx, uiDepth); |
---|
| 472 | pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); |
---|
| 473 | pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); |
---|
[2] | 474 | } |
---|
| 475 | } |
---|
[56] | 476 | } |
---|
| 477 | else |
---|
| 478 | { |
---|
[2] | 479 | decodeInterDirPU( pcCU, uiSubPartIdx, uiDepth, uiPartIdx ); |
---|
| 480 | for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) |
---|
| 481 | { |
---|
| 482 | if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 ) |
---|
| 483 | { |
---|
| 484 | decodeRefFrmIdxPU( pcCU, uiSubPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); |
---|
| 485 | decodeMvdPU ( pcCU, uiSubPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); |
---|
| 486 | decodeMVPIdxPU ( pcSubCU, uiSubPartIdx-uiAbsPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); |
---|
| 487 | } |
---|
| 488 | } |
---|
| 489 | } |
---|
[608] | 490 | if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) ) |
---|
| 491 | { |
---|
| 492 | pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMv( TComMv(0,0), ePartSize, uiSubPartIdx, uiDepth, uiPartIdx); |
---|
| 493 | pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllRefIdx( -1, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx); |
---|
| 494 | pcCU->setInterDirSubParts( 1, uiSubPartIdx, uiPartIdx, uiDepth); |
---|
| 495 | } |
---|
[2] | 496 | } |
---|
[1179] | 497 | #endif |
---|
[773] | 498 | #if H_3D_SPIVMP |
---|
[735] | 499 | delete[] pcMvFieldSP; |
---|
| 500 | delete[] puhInterDirSP; |
---|
[724] | 501 | #endif |
---|
[2] | 502 | return; |
---|
| 503 | } |
---|
| 504 | |
---|
| 505 | /** decode inter direction for a PU block |
---|
| 506 | * \param pcCU |
---|
| 507 | * \param uiAbsPartIdx |
---|
| 508 | * \param uiDepth |
---|
| 509 | * \param uiPartIdx |
---|
| 510 | * \returns Void |
---|
| 511 | */ |
---|
| 512 | Void TDecEntropy::decodeInterDirPU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx ) |
---|
| 513 | { |
---|
| 514 | UInt uiInterDir; |
---|
| 515 | |
---|
| 516 | if ( pcCU->getSlice()->isInterP() ) |
---|
| 517 | { |
---|
| 518 | uiInterDir = 1; |
---|
| 519 | } |
---|
| 520 | else |
---|
| 521 | { |
---|
[608] | 522 | m_pcEntropyDecoderIf->parseInterDir( pcCU, uiInterDir, uiAbsPartIdx ); |
---|
[2] | 523 | } |
---|
| 524 | |
---|
| 525 | pcCU->setInterDirSubParts( uiInterDir, uiAbsPartIdx, uiPartIdx, uiDepth ); |
---|
| 526 | } |
---|
| 527 | |
---|
| 528 | Void TDecEntropy::decodeRefFrmIdxPU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList ) |
---|
| 529 | { |
---|
[608] | 530 | Int iRefFrmIdx = 0; |
---|
| 531 | Int iParseRefFrmIdx = pcCU->getInterDir( uiAbsPartIdx ) & ( 1 << eRefList ); |
---|
| 532 | |
---|
| 533 | if ( pcCU->getSlice()->getNumRefIdx( eRefList ) > 1 && iParseRefFrmIdx ) |
---|
[2] | 534 | { |
---|
[608] | 535 | m_pcEntropyDecoderIf->parseRefFrmIdx( pcCU, iRefFrmIdx, eRefList ); |
---|
[2] | 536 | } |
---|
[608] | 537 | else if ( !iParseRefFrmIdx ) |
---|
| 538 | { |
---|
| 539 | iRefFrmIdx = NOT_VALID; |
---|
| 540 | } |
---|
[2] | 541 | else |
---|
| 542 | { |
---|
[608] | 543 | iRefFrmIdx = 0; |
---|
| 544 | } |
---|
[2] | 545 | |
---|
[608] | 546 | PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx ); |
---|
| 547 | pcCU->getCUMvField( eRefList )->setAllRefIdx( iRefFrmIdx, ePartSize, uiAbsPartIdx, uiDepth, uiPartIdx ); |
---|
[2] | 548 | } |
---|
| 549 | |
---|
| 550 | /** decode motion vector difference for a PU block |
---|
| 551 | * \param pcCU |
---|
| 552 | * \param uiAbsPartIdx |
---|
| 553 | * \param uiDepth |
---|
| 554 | * \param uiPartIdx |
---|
| 555 | * \param eRefList |
---|
| 556 | * \returns Void |
---|
| 557 | */ |
---|
| 558 | Void TDecEntropy::decodeMvdPU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList ) |
---|
| 559 | { |
---|
| 560 | if ( pcCU->getInterDir( uiAbsPartIdx ) & ( 1 << eRefList ) ) |
---|
| 561 | { |
---|
| 562 | m_pcEntropyDecoderIf->parseMvd( pcCU, uiAbsPartIdx, uiPartIdx, uiDepth, eRefList ); |
---|
| 563 | } |
---|
| 564 | } |
---|
| 565 | |
---|
[1196] | 566 | #if H_3D |
---|
[2] | 567 | Void TDecEntropy::decodeMVPIdxPU( TComDataCU* pcSubCU, UInt uiPartAddr, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList ) |
---|
| 568 | { |
---|
[56] | 569 | Int iMVPIdx = -1; |
---|
[2] | 570 | |
---|
[1179] | 571 | if ( (pcSubCU->getInterDir(uiPartAddr) & ( 1 << eRefList )) ) |
---|
| 572 | { |
---|
| 573 | m_pcEntropyDecoderIf->parseMVPIdx( iMVPIdx ); |
---|
| 574 | #if H_MV_ENC_DEC_TRAC |
---|
| 575 | #if ENC_DEC_TRACE |
---|
| 576 | if ( eRefList == REF_PIC_LIST_0 ) |
---|
| 577 | { |
---|
| 578 | DTRACE_PU("mvp_l0_flag", iMVPIdx) |
---|
| 579 | } |
---|
| 580 | else |
---|
| 581 | { |
---|
| 582 | DTRACE_PU("mvp_l1_flag", iMVPIdx) |
---|
| 583 | } |
---|
| 584 | #endif |
---|
| 585 | #endif |
---|
| 586 | } |
---|
| 587 | pcSubCU->setMVPIdxSubParts( iMVPIdx, eRefList, uiPartAddr, uiPartIdx, uiDepth ); |
---|
| 588 | } |
---|
| 589 | |
---|
| 590 | Void TDecEntropy::decodeMvsAMVP( TComDataCU* pcSubCU, UInt uiPartAddr, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList ) |
---|
| 591 | { |
---|
[2] | 592 | TComMv cZeroMv( 0, 0 ); |
---|
| 593 | TComMv cMv = cZeroMv; |
---|
| 594 | Int iRefIdx = -1; |
---|
| 595 | |
---|
| 596 | TComCUMvField* pcSubCUMvField = pcSubCU->getCUMvField( eRefList ); |
---|
| 597 | AMVPInfo* pAMVPInfo = pcSubCUMvField->getAMVPInfo(); |
---|
| 598 | |
---|
| 599 | iRefIdx = pcSubCUMvField->getRefIdx(uiPartAddr); |
---|
| 600 | cMv = cZeroMv; |
---|
[56] | 601 | |
---|
[1179] | 602 | pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo); |
---|
| 603 | pcSubCU->setMVPNumSubParts(pAMVPInfo->iN, eRefList, uiPartAddr, uiPartIdx, uiDepth); |
---|
| 604 | if ( iRefIdx >= 0 ) |
---|
| 605 | { |
---|
| 606 | m_pcPrediction->getMvPredAMVP( pcSubCU, uiPartIdx, uiPartAddr, eRefList, cMv); |
---|
| 607 | cMv += pcSubCUMvField->getMvd( uiPartAddr ); |
---|
| 608 | } |
---|
| 609 | |
---|
| 610 | PartSize ePartSize = pcSubCU->getPartitionSize( uiPartAddr ); |
---|
| 611 | pcSubCU->getCUMvField( eRefList )->setAllMv(cMv, ePartSize, uiPartAddr, 0, uiPartIdx); |
---|
| 612 | } |
---|
| 613 | #else |
---|
| 614 | Void TDecEntropy::decodeMVPIdxPU( TComDataCU* pcSubCU, UInt uiPartAddr, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList ) |
---|
| 615 | { |
---|
| 616 | Int iMVPIdx = -1; |
---|
| 617 | |
---|
| 618 | TComMv cZeroMv( 0, 0 ); |
---|
| 619 | TComMv cMv = cZeroMv; |
---|
| 620 | Int iRefIdx = -1; |
---|
| 621 | |
---|
| 622 | TComCUMvField* pcSubCUMvField = pcSubCU->getCUMvField( eRefList ); |
---|
| 623 | AMVPInfo* pAMVPInfo = pcSubCUMvField->getAMVPInfo(); |
---|
| 624 | |
---|
| 625 | iRefIdx = pcSubCUMvField->getRefIdx(uiPartAddr); |
---|
| 626 | cMv = cZeroMv; |
---|
| 627 | |
---|
[608] | 628 | if ( (pcSubCU->getInterDir(uiPartAddr) & ( 1 << eRefList )) ) |
---|
[56] | 629 | { |
---|
| 630 | m_pcEntropyDecoderIf->parseMVPIdx( iMVPIdx ); |
---|
[608] | 631 | #if H_MV_ENC_DEC_TRAC |
---|
| 632 | #if ENC_DEC_TRACE |
---|
| 633 | if ( eRefList == REF_PIC_LIST_0 ) |
---|
| 634 | { |
---|
| 635 | DTRACE_PU("mvp_l0_flag", iMVPIdx) |
---|
| 636 | } |
---|
| 637 | else |
---|
| 638 | { |
---|
| 639 | DTRACE_PU("mvp_l1_flag", iMVPIdx) |
---|
| 640 | } |
---|
[56] | 641 | #endif |
---|
[608] | 642 | #endif |
---|
[56] | 643 | } |
---|
[2] | 644 | pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo); |
---|
| 645 | pcSubCU->setMVPNumSubParts(pAMVPInfo->iN, eRefList, uiPartAddr, uiPartIdx, uiDepth); |
---|
| 646 | pcSubCU->setMVPIdxSubParts( iMVPIdx, eRefList, uiPartAddr, uiPartIdx, uiDepth ); |
---|
| 647 | if ( iRefIdx >= 0 ) |
---|
| 648 | { |
---|
[608] | 649 | m_pcPrediction->getMvPredAMVP( pcSubCU, uiPartIdx, uiPartAddr, eRefList, cMv); |
---|
[2] | 650 | cMv += pcSubCUMvField->getMvd( uiPartAddr ); |
---|
| 651 | } |
---|
| 652 | |
---|
| 653 | PartSize ePartSize = pcSubCU->getPartitionSize( uiPartAddr ); |
---|
[56] | 654 | pcSubCU->getCUMvField( eRefList )->setAllMv(cMv, ePartSize, uiPartAddr, 0, uiPartIdx); |
---|
[2] | 655 | } |
---|
[1179] | 656 | #endif |
---|
[1196] | 657 | |
---|
[872] | 658 | Void TDecEntropy::xDecodeTransform( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP, Int quadtreeTULog2MinSizeInCU) |
---|
[2] | 659 | { |
---|
[1179] | 660 | |
---|
| 661 | #if H_MV_ENC_DEC_TRAC |
---|
| 662 | #if ENC_DEC_TRACE |
---|
| 663 | UInt uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; |
---|
| 664 | UInt uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; |
---|
| 665 | |
---|
| 666 | DTRACE_TU_S("=========== transform_tree ===========\n") |
---|
| 667 | DTRACE_TU("x0", uiLPelX) |
---|
| 668 | DTRACE_TU("x1", uiTPelY) |
---|
| 669 | DTRACE_TU("log2TrafoSize", g_uiMaxCUWidth>>uiDepth) |
---|
| 670 | DTRACE_TU("trafoDepth" , uiDepth) |
---|
| 671 | #endif |
---|
| 672 | #endif |
---|
| 673 | |
---|
[56] | 674 | UInt uiSubdiv; |
---|
| 675 | const UInt uiLog2TrafoSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()]+2 - uiDepth; |
---|
| 676 | |
---|
| 677 | if(uiTrIdx==0) |
---|
| 678 | { |
---|
| 679 | m_bakAbsPartIdxCU = uiAbsPartIdx; |
---|
| 680 | } |
---|
| 681 | if( uiLog2TrafoSize == 2 ) |
---|
| 682 | { |
---|
| 683 | UInt partNum = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 ); |
---|
| 684 | if( ( uiAbsPartIdx % partNum ) == 0 ) |
---|
| 685 | { |
---|
| 686 | m_uiBakAbsPartIdx = uiAbsPartIdx; |
---|
| 687 | m_uiBakChromaOffset = offsetChroma; |
---|
| 688 | } |
---|
| 689 | } |
---|
| 690 | if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTRA && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_NxN && uiDepth == pcCU->getDepth(uiAbsPartIdx) ) |
---|
| 691 | { |
---|
| 692 | uiSubdiv = 1; |
---|
| 693 | } |
---|
| 694 | else if( (pcCU->getSlice()->getSPS()->getQuadtreeTUMaxDepthInter() == 1) && (pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER) && ( pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N ) && (uiDepth == pcCU->getDepth(uiAbsPartIdx)) ) |
---|
| 695 | { |
---|
[872] | 696 | uiSubdiv = (uiLog2TrafoSize > quadtreeTULog2MinSizeInCU); |
---|
[56] | 697 | } |
---|
| 698 | else if( uiLog2TrafoSize > pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) |
---|
| 699 | { |
---|
| 700 | uiSubdiv = 1; |
---|
| 701 | } |
---|
| 702 | else if( uiLog2TrafoSize == pcCU->getSlice()->getSPS()->getQuadtreeTULog2MinSize() ) |
---|
| 703 | { |
---|
| 704 | uiSubdiv = 0; |
---|
| 705 | } |
---|
[872] | 706 | else if( uiLog2TrafoSize == quadtreeTULog2MinSizeInCU ) |
---|
[56] | 707 | { |
---|
| 708 | uiSubdiv = 0; |
---|
| 709 | } |
---|
| 710 | else |
---|
| 711 | { |
---|
[872] | 712 | assert( uiLog2TrafoSize > quadtreeTULog2MinSizeInCU ); |
---|
[608] | 713 | m_pcEntropyDecoderIf->parseTransformSubdivFlag( uiSubdiv, 5 - uiLog2TrafoSize ); |
---|
[56] | 714 | } |
---|
[2] | 715 | |
---|
[56] | 716 | const UInt uiTrDepth = uiDepth - pcCU->getDepth( uiAbsPartIdx ); |
---|
[2] | 717 | { |
---|
[608] | 718 | const Bool bFirstCbfOfCU = uiTrDepth == 0; |
---|
[56] | 719 | if( bFirstCbfOfCU ) |
---|
[2] | 720 | { |
---|
[56] | 721 | pcCU->setCbfSubParts( 0, TEXT_CHROMA_U, uiAbsPartIdx, uiDepth ); |
---|
| 722 | pcCU->setCbfSubParts( 0, TEXT_CHROMA_V, uiAbsPartIdx, uiDepth ); |
---|
[2] | 723 | } |
---|
[56] | 724 | if( bFirstCbfOfCU || uiLog2TrafoSize > 2 ) |
---|
[2] | 725 | { |
---|
[1179] | 726 | #if H_3D_DISABLE_CHROMA |
---|
| 727 | if (pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 ) |
---|
| 728 | { |
---|
[1196] | 729 | if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) ) |
---|
| 730 | { |
---|
| 731 | m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth, uiDepth ); |
---|
| 732 | } |
---|
| 733 | if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth - 1 ) ) |
---|
| 734 | { |
---|
| 735 | m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth, uiDepth ); |
---|
| 736 | } |
---|
[2] | 737 | } |
---|
[1196] | 738 | else |
---|
[2] | 739 | { |
---|
[1179] | 740 | if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) ) |
---|
| 741 | { |
---|
| 742 | pcCU->setCbfSubParts( 0, TEXT_CHROMA_U, uiAbsPartIdx, uiTrDepth - 1 ); |
---|
| 743 | } |
---|
| 744 | if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth - 1 ) ) |
---|
| 745 | { |
---|
| 746 | pcCU->setCbfSubParts( 0, TEXT_CHROMA_V, uiAbsPartIdx, uiTrDepth - 1 ); |
---|
| 747 | } |
---|
| 748 | } |
---|
| 749 | #else |
---|
| 750 | if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) ) |
---|
| 751 | { |
---|
| 752 | m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth, uiDepth ); |
---|
| 753 | } |
---|
| 754 | if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth - 1 ) ) |
---|
| 755 | { |
---|
| 756 | m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth, uiDepth ); |
---|
| 757 | } |
---|
| 758 | #endif |
---|
| 759 | } |
---|
| 760 | else |
---|
| 761 | { |
---|
[56] | 762 | pcCU->setCbfSubParts( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) << uiTrDepth, TEXT_CHROMA_U, uiAbsPartIdx, uiDepth ); |
---|
| 763 | pcCU->setCbfSubParts( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth - 1 ) << uiTrDepth, TEXT_CHROMA_V, uiAbsPartIdx, uiDepth ); |
---|
[2] | 764 | } |
---|
| 765 | } |
---|
| 766 | |
---|
[56] | 767 | if( uiSubdiv ) |
---|
[2] | 768 | { |
---|
[56] | 769 | UInt size; |
---|
| 770 | width >>= 1; |
---|
| 771 | height >>= 1; |
---|
| 772 | size = width*height; |
---|
| 773 | uiTrIdx++; |
---|
| 774 | ++uiDepth; |
---|
| 775 | const UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); |
---|
| 776 | const UInt uiStartAbsPartIdx = uiAbsPartIdx; |
---|
| 777 | UInt uiYCbf = 0; |
---|
| 778 | UInt uiUCbf = 0; |
---|
| 779 | UInt uiVCbf = 0; |
---|
| 780 | |
---|
| 781 | for( Int i = 0; i < 4; i++ ) |
---|
[2] | 782 | { |
---|
[872] | 783 | xDecodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP, quadtreeTULog2MinSizeInCU ); |
---|
[608] | 784 | uiYCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrDepth+1 ); |
---|
| 785 | uiUCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth+1 ); |
---|
| 786 | uiVCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth+1 ); |
---|
[56] | 787 | uiAbsPartIdx += uiQPartNum; |
---|
| 788 | offsetLuma += size; offsetChroma += (size>>2); |
---|
[2] | 789 | } |
---|
[56] | 790 | |
---|
| 791 | for( UInt ui = 0; ui < 4 * uiQPartNum; ++ui ) |
---|
| 792 | { |
---|
[608] | 793 | pcCU->getCbf( TEXT_LUMA )[uiStartAbsPartIdx + ui] |= uiYCbf << uiTrDepth; |
---|
| 794 | pcCU->getCbf( TEXT_CHROMA_U )[uiStartAbsPartIdx + ui] |= uiUCbf << uiTrDepth; |
---|
| 795 | pcCU->getCbf( TEXT_CHROMA_V )[uiStartAbsPartIdx + ui] |= uiVCbf << uiTrDepth; |
---|
[56] | 796 | } |
---|
[2] | 797 | } |
---|
| 798 | else |
---|
| 799 | { |
---|
[56] | 800 | assert( uiDepth >= pcCU->getDepth( uiAbsPartIdx ) ); |
---|
| 801 | pcCU->setTrIdxSubParts( uiTrDepth, uiAbsPartIdx, uiDepth ); |
---|
| 802 | |
---|
[608] | 803 | #if !H_MV_ENC_DEC_TRAC |
---|
[2] | 804 | { |
---|
[56] | 805 | DTRACE_CABAC_VL( g_nSymbolCounter++ ); |
---|
| 806 | DTRACE_CABAC_T( "\tTrIdx: abspart=" ); |
---|
| 807 | DTRACE_CABAC_V( uiAbsPartIdx ); |
---|
| 808 | DTRACE_CABAC_T( "\tdepth=" ); |
---|
| 809 | DTRACE_CABAC_V( uiDepth ); |
---|
| 810 | DTRACE_CABAC_T( "\ttrdepth=" ); |
---|
| 811 | DTRACE_CABAC_V( uiTrDepth ); |
---|
| 812 | DTRACE_CABAC_T( "\n" ); |
---|
[2] | 813 | } |
---|
[608] | 814 | #endif |
---|
[56] | 815 | |
---|
| 816 | pcCU->setCbfSubParts ( 0, TEXT_LUMA, uiAbsPartIdx, uiDepth ); |
---|
| 817 | 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] | 818 | { |
---|
[608] | 819 | pcCU->setCbfSubParts( 1 << uiTrDepth, TEXT_LUMA, uiAbsPartIdx, uiDepth ); |
---|
[2] | 820 | } |
---|
[56] | 821 | else |
---|
[2] | 822 | { |
---|
[608] | 823 | m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_LUMA, uiTrDepth, uiDepth ); |
---|
[2] | 824 | } |
---|
[608] | 825 | |
---|
| 826 | |
---|
[56] | 827 | // transform_unit begin |
---|
| 828 | UInt cbfY = pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA , uiTrIdx ); |
---|
| 829 | UInt cbfU = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ); |
---|
| 830 | UInt cbfV = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ); |
---|
| 831 | if( uiLog2TrafoSize == 2 ) |
---|
[2] | 832 | { |
---|
[56] | 833 | UInt partNum = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 ); |
---|
| 834 | if( ( uiAbsPartIdx % partNum ) == (partNum - 1) ) |
---|
[2] | 835 | { |
---|
[56] | 836 | cbfU = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ); |
---|
| 837 | cbfV = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ); |
---|
[2] | 838 | } |
---|
| 839 | } |
---|
[56] | 840 | if ( cbfY || cbfU || cbfV ) |
---|
[2] | 841 | { |
---|
[56] | 842 | // dQP: only for LCU |
---|
| 843 | if ( pcCU->getSlice()->getPPS()->getUseDQP() ) |
---|
[2] | 844 | { |
---|
[56] | 845 | if ( bCodeDQP ) |
---|
[2] | 846 | { |
---|
[56] | 847 | decodeQP( pcCU, m_bakAbsPartIdxCU); |
---|
| 848 | bCodeDQP = false; |
---|
[2] | 849 | } |
---|
| 850 | } |
---|
| 851 | } |
---|
[56] | 852 | if( cbfY ) |
---|
[2] | 853 | { |
---|
[56] | 854 | Int trWidth = width; |
---|
| 855 | Int trHeight = height; |
---|
| 856 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffY()+offsetLuma), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_LUMA ); |
---|
[2] | 857 | } |
---|
[56] | 858 | if( uiLog2TrafoSize > 2 ) |
---|
[2] | 859 | { |
---|
[56] | 860 | Int trWidth = width >> 1; |
---|
| 861 | Int trHeight = height >> 1; |
---|
| 862 | if( cbfU ) |
---|
[2] | 863 | { |
---|
[56] | 864 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCb()+offsetChroma), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U ); |
---|
[2] | 865 | } |
---|
[56] | 866 | if( cbfV ) |
---|
[2] | 867 | { |
---|
[56] | 868 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCr()+offsetChroma), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V ); |
---|
[2] | 869 | } |
---|
| 870 | } |
---|
| 871 | else |
---|
| 872 | { |
---|
[56] | 873 | UInt partNum = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 ); |
---|
| 874 | if( ( uiAbsPartIdx % partNum ) == (partNum - 1) ) |
---|
[2] | 875 | { |
---|
[56] | 876 | Int trWidth = width; |
---|
| 877 | Int trHeight = height; |
---|
| 878 | if( cbfU ) |
---|
[2] | 879 | { |
---|
[56] | 880 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCb()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U ); |
---|
[2] | 881 | } |
---|
[56] | 882 | if( cbfV ) |
---|
[2] | 883 | { |
---|
[56] | 884 | m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCr()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V ); |
---|
[2] | 885 | } |
---|
| 886 | } |
---|
| 887 | } |
---|
[56] | 888 | // transform_unit end |
---|
[2] | 889 | } |
---|
| 890 | } |
---|
| 891 | |
---|
[56] | 892 | Void TDecEntropy::decodeQP ( TComDataCU* pcCU, UInt uiAbsPartIdx ) |
---|
| 893 | { |
---|
| 894 | if ( pcCU->getSlice()->getPPS()->getUseDQP() ) |
---|
| 895 | { |
---|
| 896 | m_pcEntropyDecoderIf->parseDeltaQP( pcCU, uiAbsPartIdx, pcCU->getDepth( uiAbsPartIdx ) ); |
---|
| 897 | } |
---|
| 898 | } |
---|
[2] | 899 | |
---|
| 900 | |
---|
| 901 | /** decode coefficients |
---|
| 902 | * \param pcCU |
---|
| 903 | * \param uiAbsPartIdx |
---|
| 904 | * \param uiDepth |
---|
| 905 | * \param uiWidth |
---|
| 906 | * \param uiHeight |
---|
| 907 | * \returns Void |
---|
| 908 | */ |
---|
[56] | 909 | Void TDecEntropy::decodeCoeff( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP ) |
---|
[2] | 910 | { |
---|
| 911 | UInt uiMinCoeffSize = pcCU->getPic()->getMinCUWidth()*pcCU->getPic()->getMinCUHeight(); |
---|
| 912 | UInt uiLumaOffset = uiMinCoeffSize*uiAbsPartIdx; |
---|
| 913 | UInt uiChromaOffset = uiLumaOffset>>2; |
---|
[833] | 914 | #if H_3D_DIM_SDC |
---|
| 915 | if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx) ) |
---|
| 916 | { |
---|
| 917 | assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); |
---|
| 918 | assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 ); |
---|
| 919 | assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 ); |
---|
[1179] | 920 | #if H_3D_DISABLE_CHROMA |
---|
| 921 | if (pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 ) |
---|
| 922 | { |
---|
| 923 | assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); |
---|
| 924 | assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); |
---|
| 925 | } |
---|
| 926 | #else |
---|
[833] | 927 | assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); |
---|
| 928 | assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); |
---|
[1179] | 929 | #endif |
---|
[833] | 930 | } |
---|
| 931 | |
---|
| 932 | #if H_3D_INTER_SDC |
---|
| 933 | if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx) ) |
---|
| 934 | { |
---|
| 935 | assert( !pcCU->isSkipped( uiAbsPartIdx ) ); |
---|
| 936 | assert( !pcCU->isIntra( uiAbsPartIdx) ); |
---|
| 937 | assert( pcCU->getSlice()->getIsDepth() ); |
---|
| 938 | } |
---|
| 939 | #endif |
---|
| 940 | if( pcCU->getSlice()->getIsDepth() && ( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) ) ) |
---|
| 941 | { |
---|
| 942 | Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1; |
---|
| 943 | UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2; |
---|
[2] | 944 | |
---|
[833] | 945 | if( !pcCU->getSDCFlag( uiAbsPartIdx ) ) |
---|
| 946 | { |
---|
| 947 | for( Int iPart = 0; iPart < iPartNum; iPart++ ) |
---|
| 948 | { |
---|
| 949 | if( getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx + uiPartOffset*iPart ) ) < DIM_NUM_TYPE ) |
---|
| 950 | { |
---|
| 951 | m_pcEntropyDecoderIf->parseDeltaDC( pcCU, uiAbsPartIdx + uiPartOffset*iPart, uiDepth + ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ); |
---|
| 952 | } |
---|
| 953 | } |
---|
| 954 | } |
---|
| 955 | else |
---|
| 956 | { |
---|
| 957 | m_pcEntropyDecoderIf->parseDeltaDC( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 958 | return; |
---|
| 959 | } |
---|
| 960 | } |
---|
[443] | 961 | #endif |
---|
[608] | 962 | |
---|
[2] | 963 | if( pcCU->isIntra(uiAbsPartIdx) ) |
---|
| 964 | { |
---|
| 965 | } |
---|
| 966 | else |
---|
| 967 | { |
---|
[56] | 968 | UInt uiQtRootCbf = 1; |
---|
| 969 | if( !( pcCU->getPartitionSize( uiAbsPartIdx) == SIZE_2Nx2N && pcCU->getMergeFlag( uiAbsPartIdx ) ) ) |
---|
| 970 | { |
---|
[608] | 971 | m_pcEntropyDecoderIf->parseQtRootCbf( uiAbsPartIdx, uiQtRootCbf ); |
---|
[2] | 972 | } |
---|
[56] | 973 | if ( !uiQtRootCbf ) |
---|
| 974 | { |
---|
| 975 | pcCU->setCbfSubParts( 0, 0, 0, uiAbsPartIdx, uiDepth ); |
---|
| 976 | pcCU->setTrIdxSubParts( 0 , uiAbsPartIdx, uiDepth ); |
---|
| 977 | return; |
---|
| 978 | } |
---|
[2] | 979 | |
---|
| 980 | } |
---|
[872] | 981 | |
---|
| 982 | Int getQuadtreeTULog2MinSizeInCU = pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx); |
---|
| 983 | |
---|
| 984 | xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP, getQuadtreeTULog2MinSizeInCU ); |
---|
[608] | 985 | } |
---|
[189] | 986 | |
---|
[655] | 987 | #if H_3D_INTER_SDC |
---|
[833] | 988 | Void TDecEntropy::decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
| 989 | { |
---|
| 990 | pcCU->setSDCFlagSubParts( false, uiAbsPartIdx, uiDepth ); |
---|
[1179] | 991 | if ( pcCU->isSkipped( uiAbsPartIdx ) ) |
---|
| 992 | { |
---|
| 993 | return; |
---|
| 994 | } |
---|
[833] | 995 | |
---|
[1179] | 996 | |
---|
[1124] | 997 | if( ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getInterSdcFlag() ) || |
---|
| 998 | ( pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getIntraSdcWedgeFlag() ) ) |
---|
[833] | 999 | { |
---|
| 1000 | return; |
---|
| 1001 | } |
---|
| 1002 | |
---|
| 1003 | if( !pcCU->getSlice()->getIsDepth() || pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N || pcCU->isSkipped( uiAbsPartIdx ) ) |
---|
| 1004 | { |
---|
| 1005 | return; |
---|
| 1006 | } |
---|
| 1007 | |
---|
| 1008 | assert( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) ); |
---|
| 1009 | m_pcEntropyDecoderIf->parseSDCFlag( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 1010 | } |
---|
[189] | 1011 | #endif |
---|
[833] | 1012 | #if H_3D_DBBP |
---|
| 1013 | Void TDecEntropy::decodeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) |
---|
| 1014 | { |
---|
[1179] | 1015 | if( pcCU->getSlice()->getDepthBasedBlkPartFlag() && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && pcCU->getWidth(uiAbsPartIdx) > 8 && pcCU->getSlice()->getDefaultRefViewIdxAvailableFlag() ) |
---|
| 1016 | { |
---|
| 1017 | m_pcEntropyDecoderIf->parseDBBPFlag( pcCU, uiAbsPartIdx, uiDepth ); |
---|
| 1018 | } |
---|
[833] | 1019 | } |
---|
| 1020 | #endif |
---|
[189] | 1021 | |
---|
[56] | 1022 | //! \} |
---|