Changeset 1502 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
- Timestamp:
- 11 Dec 2015, 00:05:48 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1475 r1502 184 184 { 185 185 UInt prevLayerIdx = 0; 186 UInt prevLayerId = 0; 187 188 if (pcTEncTop->getNumActiveRefLayers() > 0) 186 187 if( pcTEncTop->getNumActiveRefLayers() > 0 ) 189 188 { 190 189 prevLayerIdx = pcTEncTop->getPredLayerIdx( pcTEncTop->getNumActiveRefLayers() - 1); 191 prevLayerId = pcTEncTop->getRefLayerId(prevLayerIdx); 192 } 193 194 const TComVPS *vps = pcTEncTop->getVPS(); 190 } 191 195 192 const TComSPS *sps = pcTEncTop->getSPS(); 196 193 197 const Int bitDepthLuma = vps->getBitDepth(CHANNEL_TYPE_LUMA, sps, pcTEncTop->getLayerId());198 const Int bitDepthChroma = vps->getBitDepth(CHANNEL_TYPE_CHROMA, sps, pcTEncTop->getLayerId());199 const Int prevBitDepthLuma = vps->getBitDepth(CHANNEL_TYPE_LUMA, m_ppcTEncTop[prevLayerIdx]->getSPS(), prevLayerId);200 const Int prevBitDepthChroma = vps->getBitDepth(CHANNEL_TYPE_CHROMA, m_ppcTEncTop[prevLayerIdx]->getSPS(), prevLayerId);194 const Int bitDepthLuma = sps->getBitDepth(CHANNEL_TYPE_LUMA); 195 const Int bitDepthChroma = sps->getBitDepth(CHANNEL_TYPE_CHROMA); 196 const Int prevBitDepthLuma = m_ppcTEncTop[prevLayerIdx]->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA); 197 const Int prevBitDepthChroma = m_ppcTEncTop[prevLayerIdx]->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA); 201 198 202 199 m_Enc3DAsymLUTPicUpdate.create( m_pcCfg->getCGSMaxOctantDepth() , prevBitDepthLuma, prevBitDepthChroma, bitDepthLuma, bitDepthChroma , m_pcCfg->getCGSMaxYPartNumLog2() ); 203 m_Enc3DAsymLUTPPS.create( m_pcCfg->getCGSMaxOctantDepth(), prevBitDepthLuma, prevBitDepthChroma, bitDepthLuma, bitDepthChroma 200 m_Enc3DAsymLUTPPS.create( m_pcCfg->getCGSMaxOctantDepth(), prevBitDepthLuma, prevBitDepthChroma, bitDepthLuma, bitDepthChroma, m_pcCfg->getCGSMaxYPartNumLog2() ); 204 201 205 202 if(!m_pColorMappedPic) … … 1071 1068 cabac_zero_word_padding(TComSlice *const pcSlice, TComPic *const pcPic, const std::size_t binCountsInNalUnits, const std::size_t numBytesInVclNalUnits, std::ostringstream &nalUnitData, const Bool cabacZeroWordPaddingEnabled) 1072 1069 { 1073 #if !SVC_EXTENSION1074 1070 const TComSPS &sps=*(pcSlice->getSPS()); 1075 #endif1076 1071 const Int log2subWidthCxsubHeightC = (pcPic->getComponentScaleX(COMPONENT_Cb)+pcPic->getComponentScaleY(COMPONENT_Cb)); 1077 1072 const Int minCuWidth = pcPic->getMinCUWidth(); 1078 1073 const Int minCuHeight = pcPic->getMinCUHeight(); 1079 #if SVC_EXTENSION1080 const Int paddedWidth = ((pcSlice->getPicWidthInLumaSamples() + minCuWidth - 1) / minCuWidth) * minCuWidth;1081 const Int paddedHeight= ((pcSlice->getPicHeightInLumaSamples() + minCuHeight - 1) / minCuHeight) * minCuHeight;1082 const Int rawBits = paddedWidth * paddedHeight *1083 (pcSlice->getBitDepth(CHANNEL_TYPE_LUMA) + 2*(pcSlice->getBitDepth(CHANNEL_TYPE_CHROMA)>>log2subWidthCxsubHeightC));1084 #else1085 1074 const Int paddedWidth = ((sps.getPicWidthInLumaSamples() + minCuWidth - 1) / minCuWidth) * minCuWidth; 1086 1075 const Int paddedHeight= ((sps.getPicHeightInLumaSamples() + minCuHeight - 1) / minCuHeight) * minCuHeight; 1087 1076 const Int rawBits = paddedWidth * paddedHeight * 1088 1077 (sps.getBitDepth(CHANNEL_TYPE_LUMA) + 2*(sps.getBitDepth(CHANNEL_TYPE_CHROMA)>>log2subWidthCxsubHeightC)); 1089 #endif1090 1078 const std::size_t threshold = (32/3)*numBytesInVclNalUnits + (rawBits/32); 1091 1079 if (binCountsInNalUnits >= threshold) … … 1667 1655 { 1668 1656 //downsampling 1669 xDownScalePic(pcPic->getPicYuvOrg(), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvOrg(), pcSlice->get BitDepths(), pcPic->getPosScalingFactor(refLayerIdc, 0));1657 xDownScalePic(pcPic->getPicYuvOrg(), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvOrg(), pcSlice->getSPS()->getBitDepths(), pcPic->getPosScalingFactor(refLayerIdc, 0)); 1670 1658 1671 1659 m_Enc3DAsymLUTPPS.setDsOrigPic(pcSlice->getBaseColPic(refLayerIdc)->getPicYuvOrg()); … … 1698 1686 if( pcSlice->getVPS()->isSamplePredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), pcSlice->getVPS()->getLayerIdxInVps(refLayerId) ) ) 1699 1687 { 1700 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->get BitDepth(CHANNEL_TYPE_LUMA), pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getBitDepth(CHANNEL_TYPE_CHROMA) );1688 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA), pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA) ); 1701 1689 } 1702 1690 } … … 2383 2371 } 2384 2372 2385 #if SVC_EXTENSION2386 sliceQP = Clip3( -pcSlice->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, sliceQP );2387 #else2388 2373 sliceQP = Clip3( -pcSlice->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, sliceQP ); 2389 #endif2390 2374 m_pcRateCtrl->getRCPic()->setPicEstQP( sliceQP ); 2391 2375 … … 2700 2684 { 2701 2685 SEIDecodedPictureHash *decodedPictureHashSei = new SEIDecodedPictureHash(); 2702 #if SVC_EXTENSION2703 m_seiEncoder.initDecodedPictureHashSEI(decodedPictureHashSei, pcPic, digestStr, pcSlice->getBitDepths());2704 #else2705 2686 m_seiEncoder.initDecodedPictureHashSEI(decodedPictureHashSei, pcPic, digestStr, pcSlice->getSPS()->getBitDepths()); 2706 #endif2707 2687 trailingSeiMessages.push_back(decodedPictureHashSei); 2708 2688 } … … 2882 2862 if (!bCalcDist) 2883 2863 { 2884 #if SVC_EXTENSION2885 ruiDist = xFindDistortionFrame(pcPic->getPicYuvOrg(), pcPic->getPicYuvRec(), pcPic->getSlice(0)->getBitDepths());2886 #else2887 2864 ruiDist = xFindDistortionFrame(pcPic->getPicYuvOrg(), pcPic->getPicYuvRec(), pcPic->getPicSym()->getSPS().getBitDepths()); 2888 #endif2889 2865 } 2890 2866 } … … 3098 3074 pRec += iRecStride; 3099 3075 } 3100 #if SVC_EXTENSION3101 const Int maxval = 255 << (pcPic->getSlice(0)->getBitDepth(toChannelType(ch)) - 8);3102 #else3103 3076 const Int maxval = 255 << (pcPic->getPicSym()->getSPS().getBitDepth(toChannelType(ch)) - 8); 3104 #endif3105 3077 const Double fRefValue = (Double) maxval * maxval * iSize; 3106 3078 dPSNR[ch] = ( uiSSDtemp ? 10.0 * log10( fRefValue / (Double)uiSSDtemp ) : 999.99 ); … … 3254 3226 const InputColourSpaceConversion conversion, const Bool printFrameMSE ) 3255 3227 { 3256 #if !SVC_EXTENSION3257 3228 const TComSPS &sps=pcPicOrgFirstField->getPicSym()->getSPS(); 3258 #endif3259 3229 Double dPSNR[MAX_NUM_COMPONENT]; 3260 3230 TComPic *apcPicOrgFields[2]={pcPicOrgFirstField, pcPicOrgSecondField}; … … 3317 3287 } 3318 3288 } 3319 #if SVC_EXTENSION3320 const Int maxval = 255 << (pcPicOrgFirstField->getSlice(0)->getBitDepth(toChannelType(ch)) - 8);3321 #else3322 3289 const Int maxval = 255 << (sps.getBitDepth(toChannelType(ch)) - 8); 3323 #endif3324 3290 const Double fRefValue = (Double) maxval * maxval * iSize*2; 3325 3291 dPSNR[ch] = ( uiSSDtemp ? 10.0 * log10( fRefValue / (Double)uiSSDtemp ) : 999.99 ); … … 3601 3567 3602 3568 Int qp = pcPic->getSlice(0)->getSliceQp(); 3603 #if SVC_EXTENSION3604 const Int bitDepthLuma=pcPic->getSlice(0)->getBitDepth(CHANNEL_TYPE_LUMA);3605 #else3606 3569 const Int bitDepthLuma=pcPic->getSlice(0)->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA); 3607 #endif3608 3570 Int bitdepthScale = 1 << (bitDepthLuma-8); 3609 3571 Int beta = TComLoopFilter::getBeta( qp ) * bitdepthScale; … … 4096 4058 } 4097 4059 4098 Void TEncGOP::xDownScalePic( TComPicYuv* pcYuvSrc, TComPicYuv* pcYuvDest, BitDepths& bitDepth, const Int posScalingFactorX)4060 Void TEncGOP::xDownScalePic( TComPicYuv* pcYuvSrc, TComPicYuv* pcYuvDest, const BitDepths& bitDepth, const Int posScalingFactorX) 4099 4061 { 4100 4062 pcYuvSrc->setBorderExtension(false); … … 4158 4120 #endif 4159 4121 #endif 4160 Void TEncGOP::xFilterImg( Pel *src, Int iSrcStride, Pel *dst, Int iDstStride, Int height, Int width, BitDepths& bitDepth, ComponentID comp )4122 Void TEncGOP::xFilterImg( Pel *src, Int iSrcStride, Pel *dst, Int iDstStride, Int height, Int width, const BitDepths& bitDepth, ComponentID comp ) 4161 4123 { 4162 4124 Int height2, width2;
Note: See TracChangeset for help on using the changeset viewer.