Changeset 837 in 3DVCSoftware for branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder
- Timestamp:
- 8 Feb 2014, 00:23:11 (11 years ago)
- Location:
- branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/AnnexBread.cpp
r608 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/AnnexBread.h
r608 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/NALread.cpp
r608 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 70 70 break; 71 71 } 72 assert(*it_read <= 0x03); 72 73 } 73 74 zeroCount = (*it_read == 0x00) ? zeroCount+1 : 0; … … 126 127 else 127 128 { 128 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_T LA_R129 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_R 129 130 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N 130 131 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_R -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/NALread.h
r608 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/SEIread.cpp
r655 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 443 443 if( !pHRD->getSubPicCpbParamsPresentFlag() ) 444 444 { 445 READ_FLAG( code, "rap_cpb_params_present_flag" ); sei.m_rapCpbParamsPresentFlag = code; 445 READ_FLAG( code, "irap_cpb_params_present_flag" ); sei.m_rapCpbParamsPresentFlag = code; 446 } 447 if( sei.m_rapCpbParamsPresentFlag ) 448 { 449 READ_CODE( pHRD->getCpbRemovalDelayLengthMinus1() + 1, code, "cpb_delay_offset" ); sei.m_cpbDelayOffset = code; 450 READ_CODE( pHRD->getDpbOutputDelayLengthMinus1() + 1, code, "dpb_delay_offset" ); sei.m_dpbDelayOffset = code; 446 451 } 447 452 //read splicing flag and cpb_removal_delay_delta … … 450 455 READ_CODE( ( pHRD->getCpbRemovalDelayLengthMinus1() + 1 ), code, "au_cpb_removal_delay_delta_minus1" ); 451 456 sei.m_auCpbRemovalDelayDelta = code + 1; 452 if( sei.m_rapCpbParamsPresentFlag )453 {454 READ_CODE( pHRD->getCpbRemovalDelayLengthMinus1() + 1, code, "cpb_delay_offset" ); sei.m_cpbDelayOffset = code;455 READ_CODE( pHRD->getDpbOutputDelayLengthMinus1() + 1, code, "dpb_delay_offset" ); sei.m_dpbDelayOffset = code;456 }457 457 for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ ) 458 458 { -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/SEIread.h
r608 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/SyntaxElementParser.cpp
r655 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 3, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/SyntaxElementParser.h
r608 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/TDecBinCoder.h
r608 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/TDecBinCoderCABAC.cpp
r608 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/TDecBinCoderCABAC.h
r608 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
r833 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 3, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 848 848 READ_UVLC( uiCode, "log2_diff_max_min_coding_block_size" ); 849 849 pcSPS->setLog2DiffMaxMinCodingBlockSize(uiCode); 850 851 if (pcSPS->getPTL()->getGeneralPTL()->getLevelIdc() >= Level::LEVEL5) 852 { 853 assert(log2MinCUSize + pcSPS->getLog2DiffMaxMinCodingBlockSize() >= 5); 854 } 855 850 856 Int maxCUDepthDelta = uiCode; 851 857 pcSPS->setMaxCUWidth ( 1<<(log2MinCUSize + maxCUDepthDelta) ); -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/TDecCAVLC.h
r833 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/TDecCu.cpp
r833 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 918 918 #endif 919 919 920 if ( pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrDepth ) ) 921 { 920 922 //===== inverse transform ===== 921 923 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 ); 922 924 923 925 Int scalingListType = (pcCU->isIntra(uiAbsPartIdx) ? 0 : 3) + g_eTTable[(Int)TEXT_LUMA]; 924 assert(scalingListType < 6);926 assert(scalingListType < SCALING_LIST_NUM); 925 927 m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA, pcCU->getLumaIntraDir( uiAbsPartIdx ), piResi, uiStride, pcCoeff, uiWidth, uiHeight, scalingListType, useTransformSkip ); 926 928 … … 953 955 pReco += uiStride; 954 956 pRecIPred += uiRecIPredStride; 957 } 958 } 959 else 960 { 961 //===== reconstruction ===== 962 Pel* pPred = piPred; 963 Pel* pReco = piReco; 964 Pel* pRecIPred = piRecIPred; 965 for ( Int y = 0; y < uiHeight; y++ ) 966 { 967 for ( Int x = 0; x < uiWidth; x++ ) 968 { 969 pReco [ x ] = pPred[ x ]; 970 pRecIPred[ x ] = pReco[ x ]; 971 } 972 pPred += uiStride; 973 pReco += uiStride; 974 pRecIPred += uiRecIPredStride; 975 } 955 976 } 956 977 } … … 1022 1043 } 1023 1044 1045 if ( pcCU->getCbf( uiAbsPartIdx, eText, uiTrDepth ) ) 1046 { 1024 1047 //===== inverse transform ===== 1025 1048 Int curChromaQpOffset; … … 1035 1058 1036 1059 Int scalingListType = (pcCU->isIntra(uiAbsPartIdx) ? 0 : 3) + g_eTTable[(Int)eText]; 1037 assert(scalingListType < 6);1060 assert(scalingListType < SCALING_LIST_NUM); 1038 1061 m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), eText, REG_DCT, piResi, uiStride, pcCoeff, uiWidth, uiHeight, scalingListType, useTransformSkipChroma ); 1039 1062 … … 1054 1077 pReco += uiStride; 1055 1078 pRecIPred += uiRecIPredStride; 1079 } 1080 } 1081 else 1082 { 1083 //===== reconstruction ===== 1084 Pel* pPred = piPred; 1085 Pel* pReco = piReco; 1086 Pel* pRecIPred = piRecIPred; 1087 for ( Int y = 0; y < uiHeight; y++ ) 1088 { 1089 for ( Int x = 0; x < uiWidth; x++ ) 1090 { 1091 pReco [ x ] = pPred[ x ]; 1092 pRecIPred[ x ] = pReco[ x ]; 1093 } 1094 pPred += uiStride; 1095 pReco += uiStride; 1096 pRecIPred += uiRecIPredStride; 1097 } 1056 1098 } 1057 1099 } -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/TDecCu.h
r833 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp
r833 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 580 580 } 581 581 582 Void TDecEntropy::xDecodeTransform( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP )582 Void TDecEntropy::xDecodeTransform( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP, Int quadtreeTULog2MinSizeInCU) 583 583 { 584 584 UInt uiSubdiv; … … 604 604 else if( (pcCU->getSlice()->getSPS()->getQuadtreeTUMaxDepthInter() == 1) && (pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER) && ( pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N ) && (uiDepth == pcCU->getDepth(uiAbsPartIdx)) ) 605 605 { 606 uiSubdiv = (uiLog2TrafoSize > pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx));606 uiSubdiv = (uiLog2TrafoSize > quadtreeTULog2MinSizeInCU); 607 607 } 608 608 else if( uiLog2TrafoSize > pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) … … 614 614 uiSubdiv = 0; 615 615 } 616 else if( uiLog2TrafoSize == pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx))616 else if( uiLog2TrafoSize == quadtreeTULog2MinSizeInCU ) 617 617 { 618 618 uiSubdiv = 0; … … 620 620 else 621 621 { 622 assert( uiLog2TrafoSize > pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx));622 assert( uiLog2TrafoSize > quadtreeTULog2MinSizeInCU ); 623 623 m_pcEntropyDecoderIf->parseTransformSubdivFlag( uiSubdiv, 5 - uiLog2TrafoSize ); 624 624 } … … 666 666 for( Int i = 0; i < 4; i++ ) 667 667 { 668 xDecodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP );668 xDecodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP, quadtreeTULog2MinSizeInCU ); 669 669 uiYCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrDepth+1 ); 670 670 uiUCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth+1 ); … … 886 886 887 887 } 888 xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP ); 888 889 Int getQuadtreeTULog2MinSizeInCU = pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx); 890 891 xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP, getQuadtreeTULog2MinSizeInCU ); 889 892 } 890 893 -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/TDecEntropy.h
r833 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 210 210 211 211 private: 212 Void xDecodeTransform ( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP );212 Void xDecodeTransform ( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP, Int getQuadtreeTULog2MinSizeInCU ); 213 213 214 214 public: -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/TDecGop.cpp
r655 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 112 112 //-- For time output for each slice 113 113 long iBeforeTime = clock(); 114 115 UInt uiStartCUAddr = pcSlice->getSliceSegmentCurStartCUAddr();116 117 UInt uiSliceStartCuAddr = pcSlice->getSliceCurStartCUAddr();118 if(uiSliceStartCuAddr == uiStartCUAddr)119 {120 m_sliceStartCUAddress.push_back(uiSliceStartCuAddr);121 }122 123 114 m_pcSbacDecoder->init( (TDecBinIf*)m_pcBinCABAC ); 124 115 m_pcEntropyDecoder->setEntropyDecoder (m_pcSbacDecoder); … … 147 138 m_pcEntropyDecoder->setBitstream ( ppcSubstreams[0] ); 148 139 m_pcEntropyDecoder->resetEntropy (pcSlice); 149 150 if(uiSliceStartCuAddr == uiStartCUAddr)151 {152 m_LFCrossSliceBoundaryFlag.push_back( pcSlice->getLFCrossSliceBoundaryFlag());153 }154 140 #if H_3D_NBDV 155 141 if(pcSlice->getViewIndex() && !pcSlice->getIsDepth()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done. … … 199 185 m_pcLoopFilter->setCfg(bLFCrossTileBoundary); 200 186 m_pcLoopFilter->loopFilterPic( rpcPic ); 201 202 if(pcSlice->getSPS()->getUseSAO())203 {204 m_sliceStartCUAddress.push_back(rpcPic->getNumCUsInFrame()* rpcPic->getNumPartInCU());205 rpcPic->createNonDBFilterInfo(m_sliceStartCUAddress, 0, &m_LFCrossSliceBoundaryFlag, rpcPic->getPicSym()->getNumTiles(), bLFCrossTileBoundary);206 }207 208 187 if( pcSlice->getSPS()->getUseSAO() ) 209 188 { 210 { 211 SAOParam *saoParam = rpcPic->getPicSym()->getSaoParam(); 212 saoParam->bSaoFlag[0] = pcSlice->getSaoEnabledFlag(); 213 saoParam->bSaoFlag[1] = pcSlice->getSaoEnabledFlagChroma(); 214 m_pcSAO->setSaoLcuBasedOptimization(1); 215 m_pcSAO->createPicSaoInfo(rpcPic); 216 m_pcSAO->SAOProcess(saoParam); 217 m_pcSAO->PCMLFDisableProcess(rpcPic); 218 m_pcSAO->destroyPicSaoInfo(); 219 } 220 } 221 222 if(pcSlice->getSPS()->getUseSAO()) 223 { 224 rpcPic->destroyNonDBFilterInfo(); 189 m_pcSAO->reconstructBlkSAOParams(rpcPic, rpcPic->getPicSym()->getSAOBlkParam()); 190 m_pcSAO->SAOProcess(rpcPic); 191 m_pcSAO->PCMLFDisableProcess(rpcPic); 225 192 } 226 193 #if H_3D … … 284 251 rpcPic->setOutputMark(true); 285 252 rpcPic->setReconMark(true); 286 m_sliceStartCUAddress.clear();287 m_LFCrossSliceBoundaryFlag.clear();288 253 } 289 254 -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/TDecGop.h
r608 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 83 83 Int m_decodedPictureHashSEIEnabled; ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message 84 84 85 //! list that contains the CU address of each slice plus the end address86 std::vector<Int> m_sliceStartCUAddress;87 std::vector<Bool> m_LFCrossSliceBoundaryFlag;88 89 85 public: 90 86 TDecGop(); -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp
r833 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 78 78 , m_cCUAbsSCModel ( 1, 1, NUM_ABS_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 79 79 , m_cMVPIdxSCModel ( 1, 1, NUM_MVP_IDX_CTX , m_contextModels + m_numContextModels, m_numContextModels) 80 , m_cCUAMPSCModel ( 1, 1, NUM_CU_AMP_CTX , m_contextModels + m_numContextModels, m_numContextModels)81 80 , m_cSaoMergeSCModel ( 1, 1, NUM_SAO_MERGE_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 82 81 , m_cSaoTypeIdxSCModel ( 1, 1, NUM_SAO_TYPE_IDX_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 155 154 #endif 156 155 m_cCUPartSizeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_PART_SIZE ); 157 m_cCUAMPSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_CU_AMP_POS );158 156 m_cCUPredModeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_PRED_MODE ); 159 157 m_cCUIntraPredSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTRA_PRED_MODE ); … … 906 904 if (eMode == SIZE_2NxN) 907 905 { 908 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUAMPSCModel.get( 0, 0, 0));906 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 3 )); 909 907 if (uiSymbol == 0) 910 908 { … … 915 913 else if (eMode == SIZE_Nx2N) 916 914 { 917 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUAMPSCModel.get( 0, 0, 0));915 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 3 )); 918 916 if (uiSymbol == 0) 919 917 { … … 2009 2007 if (uiCode == 0) 2010 2008 { 2011 ruiVal = 5;2009 ruiVal = 1; 2012 2010 } 2013 2011 else 2014 2012 { 2015 ruiVal = 1; 2016 } 2017 } 2018 } 2019 2020 inline Void copySaoOneLcuParam(SaoLcuParam* psDst, SaoLcuParam* psSrc) 2021 { 2022 Int i; 2023 psDst->partIdx = psSrc->partIdx; 2024 psDst->typeIdx = psSrc->typeIdx; 2025 if (psDst->typeIdx != -1) 2026 { 2027 psDst->subTypeIdx = psSrc->subTypeIdx ; 2028 psDst->length = psSrc->length; 2029 for (i=0;i<psDst->length;i++) 2030 { 2031 psDst->offset[i] = psSrc->offset[i]; 2032 } 2033 } 2034 else 2035 { 2036 psDst->length = 0; 2037 for (i=0;i<SAO_BO_LEN;i++) 2038 { 2039 psDst->offset[i] = 0; 2040 } 2041 } 2042 } 2043 2044 Void TDecSbac::parseSaoOffset(SaoLcuParam* psSaoLcuParam, UInt compIdx) 2013 ruiVal = 2; 2014 } 2015 } 2016 } 2017 2018 { 2019 m_pcTDecBinIf->decodeBinEP ( val ); 2020 } 2021 2022 Void TDecSbac::parseSAOBlkParam (SAOBlkParam& saoBlkParam 2023 , Bool* sliceEnabled 2024 , Bool leftMergeAvail 2025 , Bool aboveMergeAvail 2026 ) 2045 2027 { 2046 2028 UInt uiSymbol; 2047 static Int iTypeLength[MAX_NUM_SAO_TYPE] = 2048 { 2049 SAO_EO_LEN, 2050 SAO_EO_LEN, 2051 SAO_EO_LEN, 2052 SAO_EO_LEN, 2053 SAO_BO_LEN 2054 }; 2055 2056 if (compIdx==2) 2057 { 2058 uiSymbol = (UInt)( psSaoLcuParam->typeIdx + 1); 2059 } 2060 else 2061 { 2062 parseSaoTypeIdx(uiSymbol); 2063 } 2064 psSaoLcuParam->typeIdx = (Int)uiSymbol - 1; 2065 if (uiSymbol) 2066 { 2067 psSaoLcuParam->length = iTypeLength[psSaoLcuParam->typeIdx]; 2068 2069 Int bitDepth = compIdx ? g_bitDepthC : g_bitDepthY; 2070 Int offsetTh = 1 << min(bitDepth - 5,5); 2071 2072 if( psSaoLcuParam->typeIdx == SAO_BO ) 2073 { 2074 for(Int i=0; i< psSaoLcuParam->length; i++) 2075 { 2076 parseSaoMaxUvlc(uiSymbol, offsetTh -1 ); 2077 psSaoLcuParam->offset[i] = uiSymbol; 2029 2030 Bool isLeftMerge = false; 2031 Bool isAboveMerge= false; 2032 2033 if(leftMergeAvail) 2034 { 2035 parseSaoMerge(uiSymbol); //sao_merge_left_flag 2036 isLeftMerge = (uiSymbol?true:false); 2037 } 2038 2039 if( aboveMergeAvail && !isLeftMerge) 2040 { 2041 parseSaoMerge(uiSymbol); //sao_merge_up_flag 2042 isAboveMerge = (uiSymbol?true:false); 2043 } 2044 2045 if(isLeftMerge || isAboveMerge) //merge mode 2046 { 2047 saoBlkParam[SAO_Y].modeIdc = saoBlkParam[SAO_Cb].modeIdc = saoBlkParam[SAO_Cr].modeIdc = SAO_MODE_MERGE; 2048 saoBlkParam[SAO_Y].typeIdc = saoBlkParam[SAO_Cb].typeIdc = saoBlkParam[SAO_Cr].typeIdc = (isLeftMerge)?SAO_MERGE_LEFT:SAO_MERGE_ABOVE; 2078 2049 } 2079 for(Int i=0; i< psSaoLcuParam->length; i++) 2080 { 2081 if (psSaoLcuParam->offset[i] != 0) 2082 { 2083 m_pcTDecBinIf->decodeBinEP ( uiSymbol); 2084 if (uiSymbol) 2050 else //new or off mode 2051 { 2052 for(Int compIdx=0; compIdx < NUM_SAO_COMPONENTS; compIdx++) 2053 { 2054 SAOOffset& ctbParam = saoBlkParam[compIdx]; 2055 2056 if(!sliceEnabled[compIdx]) 2085 2057 { 2086 psSaoLcuParam->offset[i] = -psSaoLcuParam->offset[i] ; 2087 } 2088 } 2089 } 2090 parseSaoUflc(5, uiSymbol ); 2091 psSaoLcuParam->subTypeIdx = uiSymbol; 2092 } 2093 else if( psSaoLcuParam->typeIdx < 4 ) 2094 { 2095 parseSaoMaxUvlc(uiSymbol, offsetTh -1 ); psSaoLcuParam->offset[0] = uiSymbol; 2096 parseSaoMaxUvlc(uiSymbol, offsetTh -1 ); psSaoLcuParam->offset[1] = uiSymbol; 2097 parseSaoMaxUvlc(uiSymbol, offsetTh -1 ); psSaoLcuParam->offset[2] = -(Int)uiSymbol; 2098 parseSaoMaxUvlc(uiSymbol, offsetTh -1 ); psSaoLcuParam->offset[3] = -(Int)uiSymbol; 2099 if (compIdx != 2) 2058 //off 2059 ctbParam.modeIdc = SAO_MODE_OFF; 2060 continue; 2061 } 2062 2063 //type 2064 if(compIdx == SAO_Y || compIdx == SAO_Cb) 2065 { 2066 parseSaoTypeIdx(uiSymbol); //sao_type_idx_luma or sao_type_idx_chroma 2067 2068 assert(uiSymbol ==0 || uiSymbol ==1 || uiSymbol ==2); 2069 2070 if(uiSymbol ==0) //OFF 2100 2071 { 2101 parseSaoUflc(2, uiSymbol ); 2102 psSaoLcuParam->subTypeIdx = uiSymbol; 2103 psSaoLcuParam->typeIdx += psSaoLcuParam->subTypeIdx; 2104 } 2072 ctbParam.modeIdc = SAO_MODE_OFF; 2105 2073 } 2106 } 2107 else 2108 { 2109 psSaoLcuParam->length = 0; 2110 } 2111 } 2112 2113 Void TDecSbac::parseSaoOneLcuInterleaving(Int rx, Int ry, SAOParam* pSaoParam, TComDataCU* pcCU, Int iCUAddrInSlice, Int iCUAddrUpInSlice, Int allowMergeLeft, Int allowMergeUp) 2114 { 2115 Int iAddr = pcCU->getAddr(); 2116 UInt uiSymbol; 2117 for (Int iCompIdx=0; iCompIdx<3; iCompIdx++) 2118 { 2119 pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeUpFlag = 0; 2120 pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeLeftFlag = 0; 2121 pSaoParam->saoLcuParam[iCompIdx][iAddr].subTypeIdx = 0; 2122 pSaoParam->saoLcuParam[iCompIdx][iAddr].typeIdx = -1; 2123 pSaoParam->saoLcuParam[iCompIdx][iAddr].offset[0] = 0; 2124 pSaoParam->saoLcuParam[iCompIdx][iAddr].offset[1] = 0; 2125 pSaoParam->saoLcuParam[iCompIdx][iAddr].offset[2] = 0; 2126 pSaoParam->saoLcuParam[iCompIdx][iAddr].offset[3] = 0; 2127 2128 } 2129 if (pSaoParam->bSaoFlag[0] || pSaoParam->bSaoFlag[1] ) 2130 { 2131 if (rx>0 && iCUAddrInSlice!=0 && allowMergeLeft) 2132 { 2133 parseSaoMerge(uiSymbol); 2134 pSaoParam->saoLcuParam[0][iAddr].mergeLeftFlag = (Bool)uiSymbol; 2135 } 2136 if (pSaoParam->saoLcuParam[0][iAddr].mergeLeftFlag==0) 2137 { 2138 if ((ry > 0) && (iCUAddrUpInSlice>=0) && allowMergeUp) 2139 { 2140 parseSaoMerge(uiSymbol); 2141 pSaoParam->saoLcuParam[0][iAddr].mergeUpFlag = (Bool)uiSymbol; 2142 } 2143 } 2144 } 2145 2146 for (Int iCompIdx=0; iCompIdx<3; iCompIdx++) 2147 { 2148 if ((iCompIdx == 0 && pSaoParam->bSaoFlag[0]) || (iCompIdx > 0 && pSaoParam->bSaoFlag[1]) ) 2149 { 2150 if (rx>0 && iCUAddrInSlice!=0 && allowMergeLeft) 2151 { 2152 pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeLeftFlag = pSaoParam->saoLcuParam[0][iAddr].mergeLeftFlag; 2153 } 2154 else 2155 { 2156 pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeLeftFlag = 0; 2157 } 2158 2159 if (pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeLeftFlag==0) 2160 { 2161 if ((ry > 0) && (iCUAddrUpInSlice>=0) && allowMergeUp) 2162 { 2163 pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeUpFlag = pSaoParam->saoLcuParam[0][iAddr].mergeUpFlag; 2074 else if(uiSymbol == 1) //BO 2075 { 2076 ctbParam.modeIdc = SAO_MODE_NEW; 2077 ctbParam.typeIdc = SAO_TYPE_START_BO; 2078 } 2079 else //2, EO 2080 { 2081 ctbParam.modeIdc = SAO_MODE_NEW; 2082 ctbParam.typeIdc = SAO_TYPE_START_EO; 2083 } 2084 2085 } 2086 else //Cr, follow Cb SAO type 2087 { 2088 ctbParam.modeIdc = saoBlkParam[SAO_Cb].modeIdc; 2089 ctbParam.typeIdc = saoBlkParam[SAO_Cb].typeIdc; 2090 } 2091 2092 if(ctbParam.modeIdc == SAO_MODE_NEW) 2093 { 2094 Int offset[4]; 2095 for(Int i=0; i< 4; i++) 2096 { 2097 parseSaoMaxUvlc(uiSymbol, g_saoMaxOffsetQVal[compIdx] ); //sao_offset_abs 2098 offset[i] = (Int)uiSymbol; 2099 } 2100 2101 if(ctbParam.typeIdc == SAO_TYPE_START_BO) 2102 { 2103 for(Int i=0; i< 4; i++) 2104 { 2105 if(offset[i] != 0) 2106 { 2107 parseSaoSign(uiSymbol); //sao_offset_sign 2108 if(uiSymbol) 2109 { 2110 offset[i] = -offset[i]; 2111 } 2112 } 2113 } 2114 parseSaoUflc(NUM_SAO_BO_CLASSES_LOG2, uiSymbol ); //sao_band_position 2115 ctbParam.typeAuxInfo = uiSymbol; 2116 2117 for(Int i=0; i<4; i++) 2118 { 2119 ctbParam.offset[(ctbParam.typeAuxInfo+i)%MAX_NUM_SAO_CLASSES] = offset[i]; 2120 } 2121 2122 } 2123 else //EO 2124 { 2125 ctbParam.typeAuxInfo = 0; 2126 2127 if(compIdx == SAO_Y || compIdx == SAO_Cb) 2128 { 2129 parseSaoUflc(NUM_SAO_EO_TYPES_LOG2, uiSymbol ); //sao_eo_class_luma or sao_eo_class_chroma 2130 ctbParam.typeIdc += uiSymbol; 2164 2131 } 2165 2132 else 2166 2133 { 2167 pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeUpFlag = 0; 2168 } 2169 if (!pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeUpFlag) 2170 { 2171 pSaoParam->saoLcuParam[2][iAddr].typeIdx = pSaoParam->saoLcuParam[1][iAddr].typeIdx; 2172 parseSaoOffset(&(pSaoParam->saoLcuParam[iCompIdx][iAddr]), iCompIdx); 2173 } 2174 else 2175 { 2176 copySaoOneLcuParam(&pSaoParam->saoLcuParam[iCompIdx][iAddr], &pSaoParam->saoLcuParam[iCompIdx][iAddr-pSaoParam->numCuInWidth]); 2177 } 2178 } 2179 else 2180 { 2181 copySaoOneLcuParam(&pSaoParam->saoLcuParam[iCompIdx][iAddr], &pSaoParam->saoLcuParam[iCompIdx][iAddr-1]); 2182 } 2183 } 2184 else 2185 { 2186 pSaoParam->saoLcuParam[iCompIdx][iAddr].typeIdx = -1; 2187 pSaoParam->saoLcuParam[iCompIdx][iAddr].subTypeIdx = 0; 2134 ctbParam.typeIdc = saoBlkParam[SAO_Cb].typeIdc; 2135 } 2136 ctbParam.offset[SAO_CLASS_EO_FULL_VALLEY] = offset[0]; 2137 ctbParam.offset[SAO_CLASS_EO_HALF_VALLEY] = offset[1]; 2138 ctbParam.offset[SAO_CLASS_EO_PLAIN ] = 0; 2139 ctbParam.offset[SAO_CLASS_EO_HALF_PEAK ] = -offset[2]; 2140 ctbParam.offset[SAO_CLASS_EO_FULL_PEAK ] = -offset[3]; 2141 } 2142 } 2188 2143 } 2189 2144 } … … 2218 2173 xCopyContextsFrom(pScr); 2219 2174 } 2220 2221 #if H_3D_ARP2222 Void TDecSbac::parseARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )2223 {2224 UInt uiMaxW = pcCU->getSlice()->getARPStepNum() - 1;2225 UInt uiW = 0;2226 UInt uiOffset = pcCU->getCTXARPWFlag(uiAbsPartIdx);2227 UInt uiCode = 0;2228 2229 assert ( uiMaxW > 0 );2230 2231 m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPWSCModel.get( 0, 0, 0 + uiOffset ) );2232 2233 uiW = uiCode;2234 if( 1 == uiW )2235 {2236 #if MTK_ARP_FLAG_CABAC_SIMP_G00612237 m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPWSCModel.get( 0, 0, 2 ) );2238 #else2239 m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPWSCModel.get( 0, 0, 3 ) );2240 #endif2241 uiW += ( 1 == uiCode ? 1 : 0 );2242 }2243 #if H_MV_ENC_DEC_TRAC2244 DTRACE_CU("iv_res_pred_weight_idx", uiW )2245 #endif2246 pcCU->setARPWSubParts( ( UChar )( uiW ) , uiAbsPartIdx, uiDepth );2247 }2248 #endif2249 2250 #if H_3D_IC2251 /** parse illumination compensation flag2252 * \param pcCU2253 * \param uiAbsPartIdx2254 * \param uiDepth2255 * \returns Void2256 */2257 Void TDecSbac::parseICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )2258 {2259 UInt uiSymbol = 0;2260 #if MTK_IC_FLAG_CABAC_SIMP_G00612261 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, 0 ) );2262 #else2263 UInt uiCtxIC = pcCU->getCtxICFlag( uiAbsPartIdx );2264 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, uiCtxIC ) );2265 #endif2266 #if !H_MV_ENC_DEC_TRAC2267 DTRACE_CABAC_VL( g_nSymbolCounter++ );2268 DTRACE_CABAC_T( "\tICFlag" );2269 DTRACE_CABAC_T( "\tuiCtxIC: ");2270 DTRACE_CABAC_V( uiCtxIC );2271 DTRACE_CABAC_T( "\tuiSymbol: ");2272 DTRACE_CABAC_V( uiSymbol );2273 DTRACE_CABAC_T( "\n");2274 #else2275 DTRACE_CU("ic_flag", uiSymbol)2276 #endif2277 2278 pcCU->setICFlagSubParts( uiSymbol ? true : false , uiAbsPartIdx, 0, uiDepth );2279 }2280 #endif2281 2282 #if H_3D_INTER_SDC2283 #if QC_SDC_UNIFY_G01302284 Void TDecSbac::parseDeltaDC( TComDataCU* pcCU, UInt absPartIdx, UInt depth )2285 {2286 if( ! ( pcCU->getSDCFlag( absPartIdx ) || ( pcCU->isIntra( absPartIdx ) && getDimType( pcCU->getLumaIntraDir( absPartIdx ) ) < DIM_NUM_TYPE ) ) )2287 {2288 assert( 0 );2289 }2290 2291 UInt symbol = 0;2292 UInt uiNumSegments = 0;2293 2294 if( pcCU->isIntra( absPartIdx ) )2295 {2296 UInt dir = pcCU->getLumaIntraDir( absPartIdx );2297 uiNumSegments = isDimMode( dir ) ? 2 : 1;2298 2299 m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get( 0, 0, uiNumSegments-1 ) );2300 2301 if( pcCU->getSDCFlag( absPartIdx ) )2302 {2303 assert( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N );2304 pcCU->setTrIdxSubParts( 0, absPartIdx, depth );2305 pcCU->setCbfSubParts( 1, 1, 1, absPartIdx, depth );2306 }2307 else2308 {2309 pcCU->setLumaIntraDirSubParts( dir + symbol, absPartIdx, depth );2310 }2311 }2312 else2313 {2314 #if SEC_INTER_SDC_G01012315 uiNumSegments = 1;2316 #else2317 PartSize cPartSize = pcCU->getPartitionSize( absPartIdx );2318 uiNumSegments = ( cPartSize == SIZE_2Nx2N ) ? 1 : ( cPartSize == SIZE_NxN ? 4 : 2 );2319 #endif2320 symbol = 1;2321 }2322 2323 2324 for( UInt segment = 0; segment < uiNumSegments; segment++ )2325 {2326 Pel valDeltaDC = 0;2327 if( symbol )2328 {2329 xParseDimDeltaDC( valDeltaDC, uiNumSegments );2330 }2331 2332 if( pcCU->isIntra( absPartIdx ) )2333 {2334 UInt dir = pcCU->getLumaIntraDir( absPartIdx );2335 2336 if( pcCU->getSDCFlag( absPartIdx ) )2337 {2338 pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx );2339 }2340 else2341 {2342 pcCU->setDimDeltaDC( getDimType( dir ), segment, absPartIdx, valDeltaDC );2343 }2344 }2345 else2346 {2347 pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx );2348 }2349 }2350 }2351 2352 Void TDecSbac::parseSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )2353 {2354 UInt uiSymbol = 0;2355 UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx );2356 2357 m_pcTDecBinIf->decodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) );2358 2359 if( uiSymbol )2360 {2361 pcCU->setSDCFlagSubParts( true, uiAbsPartIdx, uiDepth );2362 pcCU->setTrIdxSubParts( 0, uiAbsPartIdx, uiDepth );2363 pcCU->setCbfSubParts( 1, 1, 1, uiAbsPartIdx, uiDepth );2364 }2365 else2366 {2367 pcCU->setSDCFlagSubParts( false, uiAbsPartIdx, uiDepth );2368 }2369 }2370 #else2371 Void TDecSbac::parseInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )2372 {2373 UInt uiSymbol = 0;2374 UInt uiCtxInterSDCFlag = pcCU->getCtxInterSDCFlag( uiAbsPartIdx );2375 2376 m_pcTDecBinIf->decodeBin( uiSymbol, m_cInterSDCFlagSCModel.get( 0, 0, uiCtxInterSDCFlag ) );2377 2378 if( uiSymbol )2379 {2380 pcCU->setInterSDCFlagSubParts( true, uiAbsPartIdx, 0, uiDepth );2381 pcCU->setTrIdxSubParts( 0, uiAbsPartIdx, uiDepth );2382 pcCU->setCbfSubParts( 1, 1, 1, uiAbsPartIdx, uiDepth );2383 }2384 else2385 {2386 pcCU->setInterSDCFlagSubParts( false, uiAbsPartIdx, 0, uiDepth);2387 }2388 }2389 2390 Void TDecSbac::parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiSegment )2391 {2392 UInt uiAbsIdx = 0;2393 UInt uiSign = 0;2394 Int iIdx = 0;2395 2396 xReadExGolombLevel( uiAbsIdx, m_cInterSDCResidualSCModel.get( 0, 0, 0 ) );2397 2398 uiAbsIdx++;2399 m_pcTDecBinIf->decodeBin( uiSign, m_cInterSDCResidualSignFlagSCModel.get( 0, 0, 0 ) );2400 iIdx = (Int)( uiSign ? -1 : 1 ) * uiAbsIdx;2401 2402 pcCU->setInterSDCSegmentDCOffset( iIdx, uiSegment, uiAbsPartIdx );2403 }2404 #endif2405 #endif2406 2407 #if H_3D_DBBP2408 Void TDecSbac::parseDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )2409 {2410 PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );2411 AOF( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) );2412 AOF( !pcCU->getSlice()->getIsDepth() );2413 AOF( ePartSize == RWTH_DBBP_PACK_MODE );2414 2415 UInt uiSymbol = 0;2416 2417 m_pcTDecBinIf->decodeBin( uiSymbol, m_cDBBPFlagSCModel.get( 0, 0, 0 ) );2418 2419 if( uiSymbol )2420 {2421 pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx, 0, uiDepth);2422 }2423 }2424 #endif2425 2426 2175 //! \} -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/TDecSbac.h
r833 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 94 94 Void parseSaoTypeIdx ( UInt& ruiVal ); 95 95 Void parseSaoUflc ( UInt uiLength, UInt& ruiVal ); 96 Void parseSaoOneLcuInterleaving(Int rx, Int ry, SAOParam* pSaoParam, TComDataCU* pcCU, Int iCUAddrInSlice, Int iCUAddrUpInSlice, Int allowMergeLeft, Int allowMergeUp);97 Void parseSaoOffset (SaoLcuParam* psSaoLcuParam, UInt compIdx);98 96 private: 99 97 Void xReadUnarySymbol ( UInt& ruiSymbol, ContextModel* pcSCModel, Int iOffset ); … … 209 207 ContextModel3DBuffer m_cMVPIdxSCModel; 210 208 211 ContextModel3DBuffer m_cCUAMPSCModel;212 209 ContextModel3DBuffer m_cSaoMergeSCModel; 213 210 ContextModel3DBuffer m_cSaoTypeIdxSCModel; -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/TDecSlice.cpp
r608 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 313 313 g_bJustDoIt = g_bEncDecTraceEnable; 314 314 #endif 315 if ( pcSlice->getSPS()->getUseSAO() && (pcSlice->getSaoEnabledFlag()||pcSlice->getSaoEnabledFlagChroma()) ) 316 { 317 SAOParam *saoParam = rpcPic->getPicSym()->getSaoParam(); 318 saoParam->bSaoFlag[0] = pcSlice->getSaoEnabledFlag(); 319 if (iCUAddr == iStartCUAddr) 320 { 321 saoParam->bSaoFlag[1] = pcSlice->getSaoEnabledFlagChroma(); 322 } 323 Int numCuInWidth = saoParam->numCuInWidth; 324 Int cuAddrInSlice = iCUAddr - rpcPic->getPicSym()->getCUOrderMap(pcSlice->getSliceCurStartCUAddr()/rpcPic->getNumPartInCU()); 325 Int cuAddrUpInSlice = cuAddrInSlice - numCuInWidth; 326 Int rx = iCUAddr % numCuInWidth; 327 Int ry = iCUAddr / numCuInWidth; 328 Int allowMergeLeft = 1; 329 Int allowMergeUp = 1; 330 if (rx!=0) 331 { 332 if (rpcPic->getPicSym()->getTileIdxMap(iCUAddr-1) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr)) 333 { 334 allowMergeLeft = 0; 335 } 336 } 337 if (ry!=0) 338 { 339 if (rpcPic->getPicSym()->getTileIdxMap(iCUAddr-numCuInWidth) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr)) 340 { 341 allowMergeUp = 0; 342 } 343 } 344 pcSbacDecoder->parseSaoOneLcuInterleaving(rx, ry, saoParam,pcCU, cuAddrInSlice, cuAddrUpInSlice, allowMergeLeft, allowMergeUp); 345 } 346 else if ( pcSlice->getSPS()->getUseSAO() ) 347 { 348 Int addr = pcCU->getAddr(); 349 SAOParam *saoParam = rpcPic->getPicSym()->getSaoParam(); 350 for (Int cIdx=0; cIdx<3; cIdx++) 351 { 352 SaoLcuParam *saoLcuParam = &(saoParam->saoLcuParam[cIdx][addr]); 353 if ( ((cIdx == 0) && !pcSlice->getSaoEnabledFlag()) || ((cIdx == 1 || cIdx == 2) && !pcSlice->getSaoEnabledFlagChroma())) 354 { 355 saoLcuParam->mergeUpFlag = 0; 356 saoLcuParam->mergeLeftFlag = 0; 357 saoLcuParam->subTypeIdx = 0; 358 saoLcuParam->typeIdx = -1; 359 saoLcuParam->offset[0] = 0; 360 saoLcuParam->offset[1] = 0; 361 saoLcuParam->offset[2] = 0; 362 saoLcuParam->offset[3] = 0; 363 } 315 316 if ( pcSlice->getSPS()->getUseSAO() ) 317 { 318 SAOBlkParam& saoblkParam = (rpcPic->getPicSym()->getSAOBlkParam())[iCUAddr]; 319 if (pcSlice->getSaoEnabledFlag()||pcSlice->getSaoEnabledFlagChroma()) 320 { 321 Bool sliceEnabled[NUM_SAO_COMPONENTS]; 322 sliceEnabled[SAO_Y] = pcSlice->getSaoEnabledFlag(); 323 sliceEnabled[SAO_Cb]= sliceEnabled[SAO_Cr]= pcSlice->getSaoEnabledFlagChroma(); 324 325 Bool leftMergeAvail = false; 326 Bool aboveMergeAvail= false; 327 328 //merge left condition 329 Int rx = (iCUAddr % uiWidthInLCUs); 330 if(rx > 0) 331 { 332 leftMergeAvail = rpcPic->getSAOMergeAvailability(iCUAddr, iCUAddr-1); 333 } 334 //merge up condition 335 Int ry = (iCUAddr / uiWidthInLCUs); 336 if(ry > 0) 337 { 338 } 339 340 pcSbacDecoder->parseSAOBlkParam( saoblkParam, sliceEnabled, leftMergeAvail, aboveMergeAvail); 341 } 342 else 343 { 364 344 } 365 345 } -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/TDecSlice.h
r655 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/TDecTop.cpp
r773 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 467 467 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 468 468 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 469 rpcPic->getPicSym()->allocSaoParam(&m_cSAO);470 469 m_cListPic.pushBack( rpcPic ); 471 470 … … 505 504 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 506 505 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 507 rpcPic->getPicSym()->allocSaoParam(&m_cSAO);508 506 } 509 507 … … 662 660 663 661 m_cSAO.destroy(); 664 m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getMaxCUWidth(), sps->getMaxCUHeight() );662 m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth() ); 665 663 m_cLoopFilter.create( sps->getMaxCUDepth() ); 666 664 } … … 670 668 { 671 669 assert( nalu.m_layerId == m_layerId ); 672 673 670 #else 674 671 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay ) … … 682 679 m_uiSliceIdx = 0; 683 680 } 681 { 682 m_apcSlicePilot->copySliceInfo( pcPic->getPicSym()->getSlice(m_uiSliceIdx-1) ); 683 } 684 684 m_apcSlicePilot->setSliceIdx(m_uiSliceIdx); 685 if (!m_bFirstSliceInPicture)686 {687 m_apcSlicePilot->copySliceInfo( pcPic->getPicSym()->getSlice(m_uiSliceIdx-1) );688 }689 685 690 686 m_apcSlicePilot->setNalUnitType(nalu.m_nalUnitType); … … 994 990 #endif 995 991 #else 996 #if FIX1071997 992 pcSlice->setRefPicList( m_cListPic, true ); 998 #else999 pcSlice->setRefPicList( m_cListPic );1000 #endif1001 1002 993 #endif 1003 994 … … 1215 1206 case NAL_UNIT_CODED_SLICE_TRAIL_R: 1216 1207 case NAL_UNIT_CODED_SLICE_TRAIL_N: 1217 case NAL_UNIT_CODED_SLICE_T LA_R:1208 case NAL_UNIT_CODED_SLICE_TSA_R: 1218 1209 case NAL_UNIT_CODED_SLICE_TSA_N: 1219 1210 case NAL_UNIT_CODED_SLICE_STSA_R: … … 1235 1226 #endif 1236 1227 break; 1228 case NAL_UNIT_EOS: 1229 m_associatedIRAPType = NAL_UNIT_INVALID; 1230 m_pocCRA = 0; 1231 m_pocRandomAccess = MAX_INT; 1232 m_prevPOC = MAX_INT; 1233 m_bFirstSliceInPicture = true; 1234 m_bFirstSliceInSequence = true; 1235 m_prevSliceSkipped = false; 1236 m_skippedPOC = 0; 1237 return false; 1238 1239 case NAL_UNIT_ACCESS_UNIT_DELIMITER: 1240 // TODO: process AU delimiter 1241 return false; 1242 1243 case NAL_UNIT_EOB: 1244 return false; 1245 1246 1247 case NAL_UNIT_RESERVED_VCL_N10: 1248 case NAL_UNIT_RESERVED_VCL_R11: 1249 case NAL_UNIT_RESERVED_VCL_N12: 1250 case NAL_UNIT_RESERVED_VCL_R13: 1251 case NAL_UNIT_RESERVED_VCL_N14: 1252 case NAL_UNIT_RESERVED_VCL_R15: 1253 1254 case NAL_UNIT_RESERVED_IRAP_VCL22: 1255 case NAL_UNIT_RESERVED_IRAP_VCL23: 1256 1257 case NAL_UNIT_RESERVED_VCL24: 1258 case NAL_UNIT_RESERVED_VCL25: 1259 case NAL_UNIT_RESERVED_VCL26: 1260 case NAL_UNIT_RESERVED_VCL27: 1261 case NAL_UNIT_RESERVED_VCL28: 1262 case NAL_UNIT_RESERVED_VCL29: 1263 case NAL_UNIT_RESERVED_VCL30: 1264 case NAL_UNIT_RESERVED_VCL31: 1265 1266 case NAL_UNIT_FILLER_DATA: 1267 case NAL_UNIT_RESERVED_NVCL41: 1268 case NAL_UNIT_RESERVED_NVCL42: 1269 case NAL_UNIT_RESERVED_NVCL43: 1270 case NAL_UNIT_RESERVED_NVCL44: 1271 case NAL_UNIT_RESERVED_NVCL45: 1272 case NAL_UNIT_RESERVED_NVCL46: 1273 case NAL_UNIT_RESERVED_NVCL47: 1274 case NAL_UNIT_UNSPECIFIED_48: 1275 case NAL_UNIT_UNSPECIFIED_49: 1276 case NAL_UNIT_UNSPECIFIED_50: 1277 case NAL_UNIT_UNSPECIFIED_51: 1278 case NAL_UNIT_UNSPECIFIED_52: 1279 case NAL_UNIT_UNSPECIFIED_53: 1280 case NAL_UNIT_UNSPECIFIED_54: 1281 case NAL_UNIT_UNSPECIFIED_55: 1282 case NAL_UNIT_UNSPECIFIED_56: 1283 case NAL_UNIT_UNSPECIFIED_57: 1284 case NAL_UNIT_UNSPECIFIED_58: 1285 case NAL_UNIT_UNSPECIFIED_59: 1286 case NAL_UNIT_UNSPECIFIED_60: 1287 case NAL_UNIT_UNSPECIFIED_61: 1288 case NAL_UNIT_UNSPECIFIED_62: 1289 case NAL_UNIT_UNSPECIFIED_63: 1237 1290 default: 1238 assert ( 1);1291 assert (0); 1239 1292 } 1240 1293 -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/TDecTop.h
r833 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 *
Note: See TracChangeset for help on using the changeset viewer.